Part Number Hot Search : 
HT82K IRFZ4 CMKT3904 2SC49 107M00 T62T8 TBA810 2074734
Product Description
Full Text Search
 

To Download TMP19A71CYUG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  32 bit tx system risc tx19 family tmp19a71cyfg ug tmp19a71fyfg ug rev 2.0 feb.2007
tmp19a71 contents 1. features.................................................................................................................... .............. 1-1 2. pin assignments and pin functions ....................................................................................... 2-1 3. prosessor core.............................................................................................................. ......... 3-1 4. memory map.................................................................................................................. ......... 4-1 5. clock / standby control .......................................................................................................... 5-1 6. watchdog timer ............................................................................................................. ........ 6-1 7. exceptions/interrupts ....................................................................................................... ....... 7-1 8. i/o ports................................................................................................................... ............... 8-1 9. debug support unit (dsu) .................................................................................................... .9 -1 10. dma controller (dmac) ...................................................................................................... . 10-1 11. 16-bit timer/event counters (tmrbs) ..................................................................................11-1 12. serial i/o (sio) ..................................................................................................................... 12-1 13. analog-to-digital converters (adcs) .................................................................................... 13-1 14. motor control circuit (pmd: programmable motor driver) ................................................... 14-1 15. encoder input circuit ...................................................................................................... ...... 15-1 16. rom correction............................................................................................................. ....... 16-1 17. flash memory ............................................................................................................... ........ 17-1 18. i/o register summary ....................................................................................................... ... 18-1 19. electrical characteristics ................................................................................................. ..... 19-1 20. package dimensions ......................................................................................................... ... 20-1
tmp19a71 32-bit risc microprocessor tx19 family tmp19a71fyfg/fyug/cyfg/cyug 1. features the tx19a core processor contained in the tmp19a71 is a family of high-performance 32-bit microprocessors that offers the speed of a 32-bit risc solution with the added advantage of a significantly reduced code size of a 16-bit archit ecture. the instruction set of the tx19a includes the high-performance mips32isa, an d is enhanced by the mips16e-tx tm application-specific extensions (ase) based on the highly code-efficient mips16eisa of mips technologies, inc. and with added instructions by toshiba. the tmp19a71 is built on a tx19a core proce sso r and contains a selection of intelligent peripherals. it is suitable for low-voltage and low-power applications. the tmp19a71 has the following features: (1) tx19a core processor (for details, re fer to the tx19a architecture manual.) 1) two instruction set architectu r e (isa) modes: 16-bit isa for code density and 32-bit isa for speed the 16-bit isa is object-code compatible with the code-efficient mips16e tm ase. ? ? ? ? ? ? ? ? ? ? the 32-bit isa is object-code compatible with the high-performance tx39 family. 2) combines high performance with low power consumption. high performance single clock cycle execution (except for save, rest ore, jump/branch instructions) 3-operand computational instructions for high instruction throughput 5-stage pipeline on-chip high-speed memory dsp function: executes 32-bit multiply-accumulate operations (32-bit x 32-bit + 64-bit = 64-bit) in a single clock cycle. low power consumption optimized design using a low-power cell library ? the information contained herein is s ubject to change without notice. 021023_d ? toshiba is continually working to improve the quality and reliability of its products. nevertheless, semiconductor devices in general can malfunction or fail due to their inherent electrical sensitivity and vulnerability to physical stress. it is the responsibi lity of the buyer, when utilizing toshiba products, to comply with the standards of safety in making a safe design for the entire system, and to a void situations in which a malfunction or failure of such toshiba products could cause loss of human life, bodily injury or damage t o property. in developing your designs, please ensure that toshiba products are used within specified operating ranges as set forth in the most recent toshiba products specific ations. also, please keep in mind the precauti ons and conditions set forth in the ?handling gui de for semiconductor devices,? or ?toshiba semi conductor reliability handbook? etc. 021023_a ? the toshiba products listed in this document are intended fo r usage in general electronics app lications (computer, personal equipment, office equipment, measuring equipm ent, industrial robotics, domestic applianc es, etc.). these toshiba products are neither intended nor warranted for usage in equipment that require s extraordinarily high quality and/or reliability or a malfunctionor failure of which may cause loss of human life or bodily injury (?uni ntended usage?). unintended usage include atomic energy control instruments, airplane or spaceship instrum ents, transportation instruments, traffic signal instruments, combustion control inst ruments, medical instruments, all types of safety devices, etc. unin tended usage of toshiba products listed in this document shall be ma de at the customer's own risk. 021023_b ? the products described in this document shall not be used or embedded to any downstream products of which manufacture, use an d/or sale are prohibited under any applicable laws and regulations. 060106_q ? the information contained herein is presented only as a guide for the applications of our products. no responsibility is assu med by toshiba for any infringements of patents or other rights of the th ird parties which may result from its use. no license is gran ted by implication or otherwise under any patent or patent rights of toshiba or others. 021023_c ? the products described in this document are subj ect to the foreign exchange and foreign trade laws. 021023_e ? for a discussion of how the reliability of microcontrollers can be predicted, please refer to section 1.3 of the chapter enti tled quality and reliability assurance/handling precautions. 030619_s 060116ebp tmp19a71 1-1
tmp19a71 programmable standby modes in which processor clocks are stopped ? ? ? ? 3) fast interrupt response suitable for real-time control distinct starting locations for each interrupt service routine automatically generated vector s for each int errupt source automatic updates of the interrupt mask level (2) on-chip program memo ry an d data memory product on-chip rom on-chip ram tmp19a71fyfg/ug 256 kbytes flash rom 10 kbytes tmp19a71cyfg/ug 256 kbytes mask rom 10 kbytes rom correction logic (8 words x 8 blocks) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (3) 8-channel dma controller interrupt- or software-triggered transfer destination: on-chip memory, on-chip peripherals (4) 4-channel 16-bit timer 16-bit interval timer mode 16-bit event counter mode 16-bit ppg output input capture (5) 4-channel general-pu rpose serial interface either uart mode or synchronous mode can be selected for 2 channels; the other 2 chann els are uart only. 50% duty cycle generation (for uart mode only) (6) 2-channel 3-phase pwm generation (pmd) generating 3-phase pwm with a resolution of 35.7 ns (at imclk = 28 mhz) dead time insertion 3-phase pwm generation disabled under abnormal condition two channels can be started synchronously. (7) 1-channel abz encoder supporting incremental encoder rotation direction detection circuit absolute position detection circuit position comparison circuit on-chip noise filter (8) 19-channel 10-bit ad converter (with internal sample and hold) high-speed conversion (min: 2.36 s) input voltage range: 0 v to 3.3 v external trigger supported fixed-channel or channel scan mode single conversion or cont inu ous conversion mode tmp19a71 1-2
tmp19a71 high-priority conversion mode ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ad conversion monitoring pmd mode (9) 1-channel watchdog timer (10) interrupt sources 2 cpu interrupts: software interrupt (within the co-processor) 37 internal interrupts: 7 priority levels (e xc luding the watchdog timer interrupt) 11 external interrupts: 7 priority le vels (excluding the nmi interrupt) (11) 75-pin input/output ports (12) standby modes three standby modes: doze, halt, stop (13) clock generator on-chip pll (x 16) clock gear: divides the high-speed clock to 1/2, 1/4 or 1/8. (14) endian little-endian fixed (15) power voltage peripheral i/o: vcc3 = 3.3v 0.3 v (t mp19a71fyfg/ug, tmp19a71cyfg/ug internal: vcc2 = 2.5v 0.2 v (mp19a71fyfg/ug internal: vccc15 = 1.5v 0.15 v (tmp19a71cyfg/ug (16) operating frequency 56 mhz (vcc2 = 2.5v 0.2 v: tmp19a71fyfg/ug) 56 mhz (vcc15 = 1.5v 0.15 v: tmp19a71cyfg/ug) (17) package p-lqfp100-1414-0.50f (14mm 14m m, 0.5-mm pitch): tmp19a71fyug/cyug p-qfp100-1420-0.65a (14mm 20mm, 0.65-mm pitch ): tmp19a71fyfg/cyfg tmp19a71 1-3
tmp19a71 dmac (8ch) tx19a proccessor core g-bus (32bit) 10-bit adc1 ejtag tx19a cpu intc imbusi/f port0 port1 10-bit adc0 uart0 uart1 ejtag port 16-bit tmr0-3 (4c h) uart3/ sio3 wdt 256kb maskrom 256kb flashrom 10 kbram cg uart2/ sio2 rom correction nmi (p95) int0 (p84) int1 (pa7) a in0 7 (p50 57) a vss a vcc0/vrefh0 txd0 (p80) rxd0 (p81) txd1 (p82) rxd1 (p83) txd2 (p86) rxd2 (p85) reset test0/1 eje p00 p07 p10 p17 tpc (p30) pcst0 (p31) pcst1 (p32) pcst2 (p33) dclk (p34) im-bus (16-bit) pcst4 (p87) pcst3 (p86) dint (p24) tdo (p23) tdi (p22) tms (p21) tck (p20) int2 (pb7) int3 (p64) int4 (p65) int5 (p66) int6 (p67) int7 (p70) int8 (p71) int9 (p72) u1 (pb0) x1 (pb1) v1 (pb2) y1 (pb3) w1 (pb4) z1 (pb5) emg1 (pb6) pmd1 encz (p92) enca (p90) encb (p91) enc u0 (pa0) x0 (pa1) v0 (pa2) y0 (pa3) w0 (pa4) z0 (pa5) emg0 (pa6) pmd0 x1 x2 sclk2/cts2 (p87) txd3 (p91) rxd3 (p90) sclk3/cts3 (p92) a in8 18 (p60 72) a vss tb0in (p93), a vcc1/vrefh1 tb1in (p70), tb2in (p71), tb0out (p94) tb3in (p72), tb1out (p87) tb2out (pa7) tb3out (pb7) ( ): default function after reset figure 1.1 tmp19a71 block diagram tmp19a71 1-4
tmp19a71 2. pin assignments and pin functions this section contains pin assignments for the tmp19a71 as well as brief descriptions of the tmp19a71 input and output signals. 2.1 tmp19a71cyfg/ug pin assignments figure 2.1 shows the pin assignment s of the TMP19A71CYUG. figure 2.1 TMP19A71CYUG pin assignments (100-pin lqfp) note 1: this pin should be set to high during a reset sequence. note 2: these signals are low active. tmp19a71 2-1
tmp19a71 figure 2.2 shows the pin assignment s of the tmp19a71cyfg. figure 2.2 tmp19a71cyfg pin assignments (100-pin qfp) note 1: this pin should be set to high during a reset sequence. note 2: these signals are low active. tmp19a71 2-2
tmp19a71 2.2 tmp19a71fyfg/ug pin assignments figure 2.3 shows the pin assignments of the tmp19a71fyug. figure 2.3 tmp19a71fyug pin assignments (100-pin lqfp) note 1: this pin should be set to high during a reset sequence. note 2: these signals are low active. tmp19a71 2-3
tmp19a71 figure 2.4 shows the pin assignments of the tmp19a71fyfg. figure 2.4 tmp19a71fyfg pin assignments (100-pin qfp) note 1: this signal must be set to high during a reset sequence. note 2: these signals are low active. tmp19a71 2-4
tmp19a71 2.3 pin names and functions table 2.3.1 lists the input and output pins of the tmp19a71, including alternate pin names and func tions for multi-function pins. table 2.3.1 pin names and functions (1/3) pin name number of pins type function p00 to p07 8 input/output port 0: individually programmable as input or output p10 to p17 8 input/output port 1: individually programmable as input or output p20 tck 1 input/output input port 20: programmable as input or output ejtag pin (schmitt-triggered input) p21 tms 1 input/output input port 21: programmable as input or output ejtag pin (schmitt-triggered input) p22 tdi 1 input/output input port 22: programmable as input or output ejtag pin (schmitt-triggered input) p23 tdo 1 input/output output port 23: programmable as input or output ejtag pin p24 dint 1 input/output input port 24: programmable as input or output ejtag pin (schmitt-triggered input) p30 tpc 1 input/output output port 30: programmable as input or output ejtag pin p31 pcst0 1 input/output output port 31: programmable as input or output ejtag pin p32 pcst1 1 input/output output port 32: programmable as input or output ejtag pin p33 pcst2 1 input/output output port 33: programmable as input or output ejtag pin p34 dclk 1 input/output output port 34: programmable as input or output ejtag pin p50 to p57 an0 to an7 8 input input port 5: input-only analog input: input to the ad converter p60 to p63 an8 to an11 4 input input port 60 to 63: input-only analog input: input to the ad converter p64 to p67 an12 to an15 int3 to int6 4 input/output input input port 64 to 67: programmable as sc hmitt-triggered input or output analog input: input to the ad converter external interrupt pins: programmable to be high-l evel, low -level, rising-edge or falling-edge sensitive p70 an16 int7 tb1in 1 input/output input input input port 70: programmable as schmitt-triggered input or output analog input: input to the ad converter external interrupt 7: programmable to be high-leve l, low-level, rising -edge or falling-edge sensitive 16-bit timer input: input to 16-bit timer 1 p71 an17 int8 tb2in 1 input/output input input input port 71: programmable as schmitt-triggered input or output analog input: input to the ad converter external interrupt 8: programmable to be high-leve l, low-level, rising -edge or falling edge sensitive 16-bit timer 2 input: input to 16-bit timer 2 p72 an18 int9 tb3in 1 input/output input input input port 72: programmable as schmitt-triggered input or output analog input: input to the ad converter external interrupt 9: programmable to be high-leve l, low-level, rising -edge or falling-edge sensitive 16-bit timer 3 input: input to 16-bit timer 3 tmp19a71 2-5
tmp19a71 table 2.3.2 pin names and functions (2/3) pin name number of pins type function p80 tx0 1 input/output output port 80: programmable as input or open-drain output serial transmit data 0 p81 rx0 1 input/output input port 81: programmable as input or output serial receive data 0 p82 tx1 1 input/output output port 82: programmable as input or open-drain output serial transmit data 1 p83 rx1 1 input/output input port 83: programmable as input or output serial receive data 1 p84 int0 tb1out 1 input/output input output port 84: programmable as schmitt-triggered input or output external interrupt pin 16-bit timer 1 output: output from 16-bit timer 1 p85 rx2 1 input/output input port 85: programmable as input or output serial receive data 2 p86 tx2 pcst3 1 input/output output output port 86: programmable as input or open-drain output serial transmit data 2 ejtag pin p87 sclk2 cts2 pcst4 1 input/output input/output output output port 87: programmable as schmitt-triggered input or open-drain output serial clock input/output 2 serial clear-to-send 2 ejtag pin p90 enca rx3 1 input/output input input port 90: programmable as schmitt-triggered input or output encoder a-phase input pin serial receive data 3 p91 encb tx3 1 input/output input output port 91: programmable as schmitt-triggered input or output encoder b-phase input pin serial transmit data 3 p92 encz sclk2 cts2 1 input/output input input/output output port 92: programmable as schmitt-triggered input or output encoder z-phase input pin serial clock input/output 3 serial clear-to-send 3 p93 tb0in 1 input/output input port 93: programmable as schmitt-triggered input or output 16-bit timer 0 input: input to 16-bit timer 0 and emergency stop input pin p94 tb0out boot (note) 1 input/output output port 94: programmable as input or output 16-bit timer 0 output: output from 16-bit timer 0 single boot mode set pin: should be set to low to start up in boot mode. p95 nmi 1 input/output input port 95: programmable as schmitt-triggered input or output nonmaskable interrupt request: programmabl e to be rising-edge or falling edge sensitive pa0 u0 1 input/output output port a0: programmable as input or output pmd0: u-phase output pa1 x0 1 input/output output port a1: programmable as input or output pmd0: x-phase output pa2 v0 1 input/output output port a2: programmable as input or output pmd0: v-phase output pa3 y0 1 input/output output port a3: programmable as input or output pmd0: y-phase output pa4 w0 1 input/output output port a4: programmable as input or output pmd0: w-phase output pa5 z0 1 input/output output port a5: programmable as input or output pmd0: z-phase output tmp19a71 2-6
tmp19a71 table 2.3.3 pin names and functions (3/3) pin name number of pins type function pa6 emg0 1 input/output input port a6: programmable as schmitt-triggered input or output pmd0: emergency stop input pin pa7 int1 tb2out 1 input/output input output port a7: programmable as schmitt-triggered input or output interrupt request 1: programmable to be high-level, low-level, rising-edge or falling-edge sensitive 16-bit timer 2 output: output from 16-bit timer 2 pb0 u1 1 input/output output port b0: programmable as input or output pmd1: u-phase output pb1 x1 1 input/output output port b1: programmable as input or output pmd1: x-phase output pb2 v1 1 input/output output port b2: programmable as input or output pmd1: v-phase output pb3 y1 1 input/output output port b3: programmable as input or output pmd1: y-phase output pb4 w1 1 input/output output port b4: programmable as input or output pmd1: w-phase output pb5 z1 1 input/output output port b5: programmable as input or output pmd1: z-phase output pb6 emg1 1 input/output input port b6: programmable as schmitt-triggered input or output pmd1: emergency stop input pin pb7 int2 tb3out 1 input/output input output port b7: programmable as schmitt-triggered input or output interrupt request 2: programmable to be high-level, low-level, rising-edge or falling edge sensitive 16-bit timer 3 output: output from 16-bit timer 3 avss 1 ground pin (0 v) for the ad converter avcc0 /vrefh0 1 3.3-v power supply pin for the ad converter 0 input pin for high reference voltage for t he ad converter (shared with the above pin) avcc1 /vrefh1 1 3.3-v power supply pin for the ad converter 1 input pin for high reference voltage for t he ad converter (shared with the above pin) eje 1 input ejtag enable (low active) reset 1 input reset: initialize lsi (schmitt-triggered i nput with internal pull-up register, low active) test0 1 test pin: this pin should be tied to logic 0. test1 1 test pin: this pin should be tied to logic 0. x1/x2 2 input/output connection pins for a resonator power supply and ground pins for the mask-version product cvcc15 1 1.5-v power supply pin for the oscillator cvss 1 ground pin (0 v) for the oscillator dvcc3 2 3.3-v power supply pin dvcc15 6 1.5-v power supply pin dvss 6 ground pin (0 v) power supply and ground pins for the flash-version product cvcc2 1 2.5-v power supply pin for the oscillator cvss 1 ground pin (0 v) for the oscillator fvcc3 (2) 3.3-v power supply pin for flash macro (shared with dvcc3) fvcc2 2 2.5-v power supply pin for flash macro fvss 2 ground pin (0 v) for flash macro dvcc3 2 3.3-v power supply pin dvcc2 4 2.5-v power supply pin dvss 4 ground pin (0v) note: this pin should be fixed to high in a mask-version product. tmp19a71 2-7
tmp19a71 3. core processor the tmp19a71 contains a high-performance 32-bi t core processor called the tx19a. for a detailed description of the core processor, refer to the tx19a architecture manual. the functions unique to the tmp19a71 not covered in the architecture manual are described below . note: all references to register addresses in the following description assume that the tmp19a71 is operating in little-endian mode. tmp19a71 3-1 3.1 power-up sequence to power up the tmp19a71, we recommend th at the core power supply (2.5 v in a flash-version product and 1.5 v in a mask-version product) be turned on first. 3.2 reset operation to reset the tmp19a71, reset must be asserted for at least a specified period of time, as shown in table 3.2.1 , after the power supply voltage has stabili zed. this tim e period is required to initialize internal circuits. if this requirement is not satisfied, the tmp19a71 may not operate properly due to improper initialization of internal circuits. the incorporated program begins executing 30 usec after reset is released. t able 3.2.1 reset input time reset timing equation (sec) required external reset input time flash-version device: at power-on, and second and subsequent resets (clkmisc.msfr = 0) fixed 1 msec after power supply has st abilized flash-version device: second and subsequent resets (clkmisc.msfr = 1) mask-version device 32/x1 4.6 us (at 7mhz/) or 6.4 us (at 5 mhz) after oscillation has stabilized note: when oscillation is started, oscillation stabilization time and pll lock-up time are additionally required. the following occur as a result of a reset: the system control coprocessor (cp0) registers within the tx19a core processor are init ialized. for details, refer to the tx19a architecture manual. ? ? ? ? the reset exception is taken. program control is t ransferred to the exception handler at a predefined address. this predefined location is called an exception vector, which directly indicates the start of the actual exception handler routine. the reset exception is always vectored to virtual address 0xbfc0_0000 (which is the same as for the nonmaskable interrupt exception). all on-chip i/o peripheral registers are initialized. all port pins, including those multiplexed with on-chip peripheral functions, are conf igured as either general-purpose inputs or general-purpose outputs. note 1: the tmp19a71 must be powered up with reset asserted. the reset state should not be terminated until after the power supply voltage stablizes within the valid operating range. note 2: there is a possibility that on-chip ram locations accessed and general-purpose registers of the selecte d bank may be corrupted during a reset.
tmp19a71 3.3 start-up routine the following explains a standard start-up routine. write a start-up routine according to the requirements of your program. 1. enable the shadow register sets set the ssd bit of the sscr register (cp0 register) to 0 to enable the shadow register sets. 2. set the global pointer r28 (gp) and the stack pointer r29 (sp) set the initial values in r28 and r29 as required . when the shadow register sets are used, it is necessary to set r29 se parately for shadow register set 0 an d shadow register sets 1 to 7. 3. set the cp0 status register in the cp0 status register, set the cu0 bit (c p0 usabilit y) to 1, the bev bit (bootstrap exception vector) to 1, and the im[4:2] field (interrupt mask) to 1, as required. 4. set the cp0 cause register set the iv bit (interrupt vector) in the cp0 cause register to 1, as required. 5. set the block decode registers it is necessary to set the block decode registers to change the data read m ethod according to whether the flash-version or mask-version device is used. if this setting is not made, internal rom data cannot be read correctly. the b0dc r and b0dlr registers should be accessed from block 0, and the b1dcr and b1dlr registers should be accessed from block 1. (programming examples) by using instructions stored at 0xbfc0_0000 to 0xbfc1_ffff (0x0000_0000 to 0x0001_ffff): b0dcr 0xf fff_e530 <-- 0x00 b0dlr 0xf fff_e534 <-- 0x3d by using instructions stored at 0xbfc2_0000 to 0xbfc3_ffff (0x0002_0000 to 0x0003_ffff): b1dcr 0xf fff_e538 <-- 0x00 b1dlr 0xf fff_e53c <-- 0x3d tmp19a71 3- 2
tmp19a71 block 0 decode control register 7 6 5 4 3 2 1 0 b0dcr bit symbol D D D D D D D b0decen (0xffff_e530) read/write r/w reset value 0 0 0 0 0 0 0 1 function 1 : f l a s h version 0: mask ver sion note 1: in the mask-version device, the b0decen bit is not initialized by a wdt reset; it is initialized by an external reset. note 2: in the flash-version device, the b0decen bit is not i nitialized by a normal reset; it is initialized by a power-on reset. note 3: the b0dcr should be accessed by an instruction stored in block 0 (0xbfc0_0000 to 0xbfc1_ffff or 0x0000_0 000 to 0x0001_ffff). block 0 decode lock register 7 6 5 4 3 2 1 0 b0dlr bit sy mbol D (0xffff_e534) read/write w reset value D D D D D D D D function the value written in the b0dlr.b0decen bit take s effect b y writing 0x3d in this register. note: the b0dlr should be accessed by an instruction stored in block 0 (0xbfc0_0000 to 0xbfc1_ffff or 0x0000_0000 to 0x0001_ffff). block 1 decode control register 7 6 5 4 3 2 1 0 b1dcr bit sy mbol D D D D D D D b1dece n (0xffff_e538) read/write r/w reset value 0 0 0 0 0 0 0 1 function 1: flash version 0: mask version note 1: in the mask-version device, the b1decen bit is not initialized by a wdt reset; it is initialized by an external reset. note 2: in the flash-version product, the b1decen bit is no t initialized by a normal reset; it is initialized by a power-on reset. note 3: the b1dcr should be accessed by an instruction stored in block 1 (0xbfc2_0000 to 0xbfc3_ffff or 0x0002_0 000 to 0x0003_ffff). block 1 decode lock register 7 6 5 4 3 2 1 0 b1dlr bit sy mbol D (0xffff_e53c) read/write w reset value D D D D D D D D function the value written in the b1dlr.b1decen bit takes effect b y writing 0x3d in this register. note: the b1dlr should be accessed by an instruction stored in block 1 (0xbfc2_0000 to 0xbfc3_ffff or 0x0002_0000 to 0x0003_ffff). tmp19a71 3-3
tmp19a71 3.4 bus cycles in a processor using pipelining like the tx19a core processor, performance is greatly influenced by pipeline hazards. to improve performance, therefore, due consideration must be given to pipeline hazards related to bus cycles. the tx19a core processor controls bus cycles asynchronous to the pipeline (non-blocking loads, etc.) to prevent degradation in performance due to pipeline hazards. in addition, taking account of dma transfer s triggered by external sources, it is extremely difficult to control bus cycles by software. the tx19a core processor is provided with the sync instruction for synchronization of bus cycles. the sync instruction stalls execution of the next instruction until all inst ructions generating bus cycles (including the write buffer) have been completed. the following gives considerations related to bus c ycles through explaining how to use the sync instruction. please note that the following considerations may not apply and other considerations may be required depending on the system. for a detailed description of the write bu ffer and bus cycles, refer to the tx19a architecture manual. 3.4.1 bus cycle execution time table 3.4.1 shows the number of clock cycles required for completing the bus cycle of a load or store i nstruction. since the start timing of each bus cycle varies depending on the write buffer and bus states, the values shown in this table may not always apply. table 3.4.1 number of clock cycles for completing bus cycles 1bit/8 bits (byte) 16 bits (half word) 32 bits (word) on-chip rom 2 clk (fsys): operand 2 clk (fsys): operand (1 clk (fsys): instruction) 2 clk (fsys): operand (1 clk (fsys): instruction) on-chip ram 1 clk (fsys) 1 clk (fsys) 1 clk (fsys) g-bus (cg/irc/dmac) cpu: 3 to 4 clk (fsys) dmac: 4 clk (fsys) cpu: 3 to 4 clk (fsys) dmac: 4 clk (fsys) cpu: 3 to 4 clk (fsys) dmac: 4 clk (fsys) im-bus (i/o registers other than g-bus) (imclk: 28 mhz) cpu: 4 to 5 clk (imclk) dmac: 4 to 5 clk (imclk) cpu: 4 to 5 clk (imclk) dmac: 4 to 5 clk (imclk) cpu: 4 to 5 clk (imclk) dmac: 4 to 5 clk (imclk) tmp19a71 3- 4
tmp19a71 3.4.2 when using instructions executed asynchronous to bus cycles table 3.4.2 lists the co-processor and special-pu r pose instructions that are executed independent of bus cycles to enable and disable interrupts and to enter standby mode. table 3.4.2 state transition instructions not requiring bus cycles operation ei interrupts are enabled 2 clock cycles after the ei instruction is executed (e stage). di interrupts are disabled immediately after the di inst ruction is executed (e stage). (the status change is reflected in the cp0 register after 2 clock cycles). mtc0 writes to the cp0 registers take effect 2 clock cycles after the mtc0 instruction is executed (e stage). (only the interrupt di sable setting takes effect immediately.) wait standby mode is entered 2 clock cycles after the wait instruction is executed. to execute these instructions, caution must be exercised on preceding bus cycles. the fo llowing examples show possible problems. example 1: enabling interrupts after clearing an interrupt source (problem example) lui r27, hi(iclr) sh r26, lo(icl r)(r27) ; clear interrupt source. mtc0 r29, ier ; enable interrupt s. nop nop ; interru pts are actually enabled. in the above example, the mtc0 instruction may be executed before the preceding bus cycle is complet ed so that interrupts are enabled before the interrupt source is cleared as intended. this problem can be avoided by inserting the sync instruction before the mtc0 instruction, as shown below. (workaround example) lui r27, hi(iclr) sh r26, lo(icl r)(r27) ; clear interrupt source. sync ; s tall the next instruction until the interrupt source is cleared. mtc0 r29, ier ; enable interrupt s. nop nop ; interru pts are actually enabled. tmp19a71 3-5
tmp19a71 example 2: exiting standby mode (problem example) ori r26, r0 , 0x0d lui r27, hi(tb0run) sb r26, lo(tb0 run)(r27) ; bit 0(trun) = 1(timer start) wait ; enter st andby mode. nop this is an example of exiting standby mode when the timer reaches the specified time. if th e wait instruction is executed before the preceding bus cycle is completed, standby mode may be entered before the timer is set, making it impossible to exit standby mode. this problem can be avoided by insertin g the sync instruction before the wait instruction so that the wait instruction is stalled until the timer starts counting, as shown below. (workaround example) ori r26, r0 , 0x0d lui r27, hi(tb0run) sb r26, lo(tb0 run)(r27) ; bit 0(trun)=1 (timer start) sync ; s tall until the timer starts counting. wait ; enter st andby mode. nop generally speaking, it is not possible to predict when a bus cycle completes. therefore, we do n ot recommend using the nop instruction instead of the sync instruction in the above examples for waiting for completion of the preceding bus cycle. tmp19a71 3- 6
tmp19a71 3.4.3 when an memory area is modified is it also necessary to exercise caution on bus cycles when a memory area is modified through the rom correction function or an external bus interface. the following shows an example of execution entering an area that is modified by rom correction immediately after the rom correction setting has been made. note: the tmp19a71 does not contai n an external bus interface. example 3: executing the rom correction target area after the rom correction setting has been made (problem example) lui r26, hi(ng_area) addiu r26, r26, lo(ng_area) ; set the addr ess of ng_area to be replaced. lui r27, hi(addreg0) sw r26, l o(addreg0)(r27) ; replace ng_area with 0xffffbf00-. ng_area: ; replaced area nop nop in the above example, execution enters the memory area to be replaced immediately aft er the rom correction setting is made. although instructions are executed sequentially here, this situation may also occu r with a jump or branch instruction. it is not normally possible to know in advance the area to be replaced with the rom correction function. therefore, the sync in struction should be inserted after an instruction for setting rom correction. in this way, the area to be replaced with the rom correction function will not be executed until the relevant processing is completed. (workaround example) lui r26, hi(ng_area) addiu r26, r26, lo(ng_area) ; set the addr ess of ng_area to be replaced. lui r27, hi(addreg0) sw r26, l o(addreg0)(r27) ; replace ng_area with 0xffffbf00-. sync ; s tall until rom correction setting is completed. ng_area: ; replaced area nop nop tmp19a71 3-7
tmp19a71 3.4.4 when the sync instruction is invalidated by an interrupt even if the sync instruction is inserted to prevent possible problems as described in the above examples, the sync instruction may be invalidated by an interrupt. the following shows such a case occurring in the above example 2 (exiting standby mode). example 4: an interrupt invalidating the sync instruction (problem example) ori r26, r0, 0x0d lui r27, hi(tb0run) sb r26, lo(tb0 run)(r27) ; bit0 (trun) = 1 (timer start) sync ; s tall until the timer starts counting. ; omitted ; <---an i nterrupt occurs here. ---- lui r27, hi(tb0run) lb r26, lo(tb0 run)(r27) ; save tb0run on the stack. sb r0 , lo(tb0 run)(r27) ; bit 0 (trun) = 0 (timer stop) (required processing) sb r26, lo(tb0 run)(r27) ; restore tb0run (timer restart). eret ; omitted ; <---end of interrupt service routine---- wait ; enter st andby mode nop this problem can be avoided by inserting the sync instruction at the end of the int errupt service routine (immediately before the eret instruction). tmp19a71 3- 8
tmp19a71 (workaround example) ori r26, r0, 0x0d lui r27, hi(tb0run) sb r26, lo(tb0 run)(r27) ; bit0 (trun) = 1 (timer start) sync ; s tall until the timer starts counting. ; omitted ; <---an i nterrupt occurs here. ---- lui r27, hi(tb0run) lb r26, lo(tb0 run)(r27) ; save tb0run on the stack. sb r0 , lo(tb0 run)(r27) ; bit 0 (trun) = 0 (timer stop) (required processing) sb r26, lo(tb0 run)(r27) ; restore tb0run (timer restart). sync ; s tall until the bus cycle of interrupt service routine completes. ; omitted ; <---end of interrupt service routine---- wait ; enter standby mode. nop tmp19a71 3-9
tmp19a71 3.4.5 write buffer 3.4.5.1 tmp19a71 write buffer the tmp19a71 contains a four-entry fifo writ e b uffer. each pipeline stage is basically executed in a single clock cycle. however, a write bus cycle accessing an area other than on-chip memory may require more than one cloc k cycle. the write buffer is provided to accommodate such speed variations so th at program execution can achieve higher performance. with the tmp19a71 write buffer, a read bus cycle (load instruction) is always stalled until the write buffer becomes empty regardless of the addresses to be accessed by store and load instructions (see figure 3.4.1 ). therefore, bus cycles are always generated in accordanc e with the program execution sequence. figure 3.4.1 tmp19a71 write buffer operation stalled cycles store instruction (1) store (1) sw r10,0x0000(r16) f store (2) sw r11,0x0004 (r16) load (3) lw r20,0x0008 (r16) d e m w f d e m w f d es m bus cycles write cycle store instruction (2) load instruction (3) write buffer write cycle read cycle es es es es e D store instruction is handled first. D w tmp19a71 3- 10
tmp19a71 3.4.5.2 tmp19a70 write buffer (for reference) with the tmp19a70 write buffer, a load instruction may be executed before the im mediately preceding store instruction. in an example shown in figure 3.4.2 , the target addr ess of the third load instruction is different from the target address of the second store instruction that is queued up in the write buffer. in this case, the read bus cycle of the load instruction is processed before the write bus cycle of the store instruction in the write buffer. (if the second and third instructions have the same target address, the load instruction is stalled until the store instruction is completed.) figure 3.4.2 tmp19a70 write buffer operat ion (wi th different target addresses) the following example shows a possible problem case with the tmp19a70 write buffer for r eference. example: reading port 0 (tmp19a70) (problem example) sb r0 , p0ier ; enable port 0 input. lb r10, p0d ; read port 0. in this example, the write buffer may cause the instruction for reading port 0 to be ex ecuted before port 0 is enabled. if this happens, the port output value will be read from port 0. this problem can be avoided by in serting the sync instruction before the load instruction, as shown below, to stall the load instruction until port 0 input is enabled. (workaround example) sb r0 , p0ier ; enable port 0 in put. sync ; s tall until port 0 input is enabled. lb r10, p0d ; read port 0. store instruction (1) store (1) sw r10,0x0000(r16) f store (2) sw r11,0x0004 (r16) load (3) lw r20,0x0008 (r16) d e m w f d e m w f d e m w bus cycles write cycle load instruction (3) store instruction (2) write buffer read cycle write cycle load instruction is handled first. e r r tmp19a71 3-11
tmp19a71 3.4.6 limitations on accessing special-function registers (sfrs) read-modify or read-modify-write instructions must be used with caution on sfrs that include write-only bits or bits that are cleared by a read. 3.4.6.1 sfrs requiring extra caution (1) registers including write-only bits if a read-modify-write instruction is executed on a register including write-only bits with und efined read values, the write operation may not be performed as expected because the value read from each write-only bit cannot be guaranteed. (2) registers including bits cleared by a read if a read-modify or read-modify-write instruction is executed on a register including bits that ar e cleared by a read, the read operation may unintentionally clear these bits. sfrs requiring extra caution are listed in the table below. table 3.4.3 sfrs requiring extra caution functional unit register write-only bits bits cleared by read cg clkact included not included clkspd included not included irc ilev included not included iclr included not included dmac dcr included not included ccrn included not included tmrb tbnmod included not included sio scnmod2 included not included scncr not included included scnbuf included not included scnfrc included not included scnftc included not included adc adnresn not included included adchprn not included included adpres0 not included included pmd emgreln included not included emgcrn included not included abz encoder entncr included not included wdt wdcr included not included flash seqmod included not included tmp19a71 3- 12
tmp19a71 3.4.6.2 bit manipulation instructions requiring extra caution the bit manipulation instructions listed in the table below are read-modify or read -modify-write instructions that must not be used on the sfrs listed in table 3.4.3 . if thes e instructions are used to access the said sfrs, unexpected operation may result. table 3.4.4 read-modify/read-modify-write instructions instruction name access length operation type bit test (btst) 8 bits read modify bit extract (bext) 8 bits read modify bit clear (bclr) 8 bits read modify write bit set (bset) 8 bits read modify write bit insert (bins) 8 bits read modify write add immediate to memory word (addmiu) 32 bits read modify write 3.4.6.3 considerations for access length discrepancy the tx19a core handles bit manipulation instructions by using the access length shown in t able 3.4.4 and internally realizing 1-bit accesses in a pseudo manner. therefore, if bit manipulation instructions are used on the sf rs shown in table 3.4.3, the correct results may not be obtained. this problem can be avoided by using the _rbi modifier that is provided in toshiba?s c compiler for inhibiting bit manipulation instru ctions. for details, re fer to the instruction manual of the c compiler. 3.4.6.4 considerations for using the c compiler if bit fields are used in the sfrs shown in table 3.4.3, the c compiler may generate bit m anipulation instructions or read-modify or read-modify-write instructions of 8-bit or larger quantity. toshiba?s c compiler provides the _rbi modifi er that can be used for inhibiting bit manipulation instructions on specified sfrs. for details, refer to the instruction manual of the c compiler. tmp19a71 3-13
tmp19a71 4. memory map figure 4.1.1 shows memory assignme nt for the tmp19a71. vertual address physical address 0x0000_0000 0xffff_ffff 0x0003_ffff 16 mbytes reserved kseg1 0xbfc0_0000 0xbfc3_ffff 0xff00_0000 kseg2 0x8000_0000 0xa000_0000 16 mbytes reserved 16 mbytes reserved kseg2 (1 gbyte) 16 mbytes reserved kuseg (2 gbytes) on-chip rom shadow inaccessible on-chip peripherals user program area exception vector area 0x4003_ffff 0x4000_0000 0x1fc3_ffff 0x1fc0_0000 maskable interrupt area on-chip ram (10 kb) reserved for debugging (2mb) (reserved) (reserved) 512 mbytes on-chip rom kuseg kseg0 0xffff_bfff 0xffff_9800 0xff3f_ffff 0xff20_0000 0xff00_0000 0x1fc3_ffff 0x1fc0_0500 0x1fc0_0000 figure 4.1.1 memory map note 1: the on-chip 256-kbyte rom is mapped to virtual addresses from 0x0000_0000 through 0x0003_ffff or 0xbfc0_0000 through 0xbfc3_ffff. the on-chip 10-kbyte ram is mapped to virtual addresses from 0xffff_9800 through 0xffff_bfff. note 2: since the physical address space from 0xffff_4000 through 0xffff_bfff is reserved as the ram area, do not access t he region except that within which ram is located. note 3: the on-chip rom is located in a linear address space beginning at physical address 0x0000_0000 or 0xbfc0_0000. a ll types of exceptions are vectored to the on-chip rom when the bev bit of the system control coprocessor?s status register is set to the default value of 1. (when bev = 0, not all exception vectors reside in contiguous locations.) when external memory is used, the bev bit can be cleared to 0. using the 0x0000_0000 32kb virtual address space helps to improve code efficiency. the virtual address space begi nning at 0x0000_0000 is a shadow of the on-chip memory beginning at 0xbfc0_0000, and references to this space are rerouted to the on-chip rom. examples: 32-bit isa ? a ccessing the 0x0000_0000 32kb space lw r2, io (_t) (r0) ; (r2) da ta of 0x0000_xxxx a ccessed with a single instruction ? a ccessing other locations lui r3, hi (_f) ; upp er 16 bits of address are loaded into r3. lw r2, io (_f) (r3) ; lo wer 16 bits of address must be added to upper 16 bits. note 4: no instruction should be placed in the last four words of the physical address space because the instruction prefet ch circuit will access a location beyond the on-chip rom area. ? 0xbfc3 _fff0 through 0xbfc3_ffff of 256-kbyte on-chip rom note 5: the tmp19a71 is always operated in the kernal mode. the user mode should not be used. tmp19a71 4-1
tmp19a71 5. clock/standby control 5.1 standby control the tmp19a71 provides support for several leve ls of power reduction. while in normal mode, setting the rp bit in the system control coprocessor (cp0)?s status register and then executing the wait instruction cause the tmp19a71 to enter one of the standby modes?idle (halt, doze) or stop?as specified by the ss field of the clkspd register. the characteristics of idle and stop modes are as follows: idle: in idle mode, the tx19a core processor stops. idle mode can be exited by a hardware interrupt, a nonmaskable interrupt (nm i) or a reset. the latter two include those triggered by the watchdog timer. if the level of a wakeup interrupt set in the ilxx field of the imrxx register is lower than the mask level set in the cmask field of the ilev register, the tmp19a71 does not wake up from idle mode. if the interrupt level is higher than the mask level, the tmp19a71 returns to normal mo de and then services the interrupt. note 1: in halt mode, the tmp19a71 freezes the tx19a core processor, preserving the pipeline state. in halt mode, the tmp19a71 ignores any external bus requests; so it continues to assume bus mastership. note 2: in doze mode, the tmp19a71 freezes the tx19a core processor, preserving the pipeline state. in doze mod e, the tmp19a71 recognizes external bus requests. stop: in stop mode, the whole tmp19a71 stops. stop mode can be exited by int0 to int3, nmi or a reset. the latter two do not inclu de those triggered by the watchdog timer. when int0 to int3 are used for waking up fro m stop mode, set clkw0.w0we = 1 for int0 and clkintx.ixki = 1 for int1 to int3. if one of these interrupts occurs and the interrupt level set in the imrxx.ilxx field is higher than the mask level set in the ilev.cmask field, the tmp19a71 returns to normal mode and then services the interrupt. the interrupt level of int0 to int3, when used for exiting stop mode, should be set to a valu e higher than the mask level. tmp19a71 5-1
tmp19a71 (1) tmp19 a71 operation in normal and standby modes table 5.1.1 tmp19a71 operation in normal and standby modes operating mode operating status normal the tx19a core processor and on-chip per ipheral s operate at frequencies specified in the cg block. idle (halt) the processor and dmac operations stop; other o n-chip peripherals are active. idle (doze) the processor stops; on-chip peri pherals including dmac are active. stop all processor and peripheral operations stop completely. (2) cl ock generation operation in normal and standby modes table 5.1.2 block generation operation in normal and standby modes clock source mode oscillator clock suppl y to peripherals clock supply to cpu normal on on on external crystal idle (halt) on on off idle (doze) on on off stop off off off on: operating, or clock supplied off: stopped, or clock not supplied (3) processor and peripheral block operation in standby modes table 5.1.3 processor and peripheral blocks in standby modes circuit block clock source idle (doze) idle (halt) stop tx19a processor core dmac intc cg fsys off on on on off off on on off off off (note 1) off (note 1) wdt i/o ports imclk on on on on off (note 2) on (note 3) note 1: in stop mode, clock supply is stopped but int0 to int3 can be used to wake up from stop mode. after stop mode is exited, the intc accepts the interrupt request. note 2: the wdt stops operating in stop mode. the wdt counter value is not cleared after stop mode is exited. note 3: i/o ports are not automatically disabled upon entering idle or stop mode. to reduce power consumption, i/o p orts should be disabled before entering idle or stop mode. tmp19a71 5- 2
tmp19a71 5.2 clock source block diagram 5.2.1 block diagram high-speed oscillator x16 pll warm-up timer 2 8 4 2 3 4 5 imclk (im bus clock) fsys (system clock) clkosc clkwut clkprsc clkprsc fc fosc x1 x2 figure 5.2.1 clock source block diagram 5.3 clock generator (cg) registers 5.3.1 register map table 5.3.1 shows the register map of the clock generator. all registers other than the clkact are 8 bits wide, but regis ters at consecutive addre sses can be accessed as a 16- or 32-bit quantity. when accessing more than one register at a time, be careful not to include any reserved area. for information about reserved areas, see ?18. i/o register summary?. table 5.3.1 clock generator registers address number of bits mnemonic register name 0xffff_d300 16 clkact clock generator activate register 0xffff_d304 8 clkosc oscillator setting register 0xffff_d305 8 clkwut warm-up setting register 0xffff_d306 8 clkspd mode switch register 0xffff_d307 8 clkprsc clock gear control register 0xffff_d30d 8 clkmisc clock generator setting register 0xffff_d310 8 clknmi nmi setting register 0xffff_d312 8 clkw0 int0 setting register 0 0xffff_d31a 8 clkint0 int0 setting register 1 0xffff_d31b 8 clkint1 int1 setting register 0xffff_d31c 8 clkint2 int2 setting register 0xffff_d31d 8 clkint3 int3 setting register note: the settings made in these cg registers take effect by writing 0x5a5a and then 0xf0f0 consecutively in the c lkact register within 64 system clock cycles after the settings are made. it this time limit is not observed, the settings will not take effect. tmp19a71 5-3
tmp19a71 5.3.2 register description clock generator activate register 7 6 5 4 3 2 1 0 bit symbol act clkact read/write w (0xffff_d300) reset value 0 0 0 0 0 0 0 0 function 15 14 13 12 11 10 9 8 bit symbol act read/write w reset value 0 0 0 0 0 0 0 0 function the settings made in the cg registers take effect by writing 0x5a5a and then 0xf0f0 consecutively in this register within 64 system clock cycles after the settings are made. note 1: this register must be accessed as a 16-bit quantity; bit manipulation instructions cannot be used. note 2: the settings made in the cg registers take effect by writing 0x5a5a and then 0xf0f0 consecutively in this register within 64 system clock cycles after the settings are made. if this time limit is not observed, the settings will not take effect. 0xffff_d31d 0x03 0xffff_d31a 0x02 0xffff_d300 0xffff_d300 0x5a5a 0xf0f0 address data 0xffff_d31a 0x02 0xffff_d300 0x5a5a 0xf0f0 address data 0xffff_d300 0xffff_d31d 0x03 0xffff_d31a 0x02 0xffff_d300 0xffff_d300 0x5a5b 0xf0f0 address data valid example invalid example 1 invalid example 2 64 clock cycles exceeded keyword input error figure 5.3.1 example of how to use the clock generator activate register tmp19a71 5- 4
tmp19a71 oscillator setting register 7 6 5 4 3 2 1 0 clkosc bit symbol xen rxen drvh (0xffff_d304) read/write r/w reset value 1 0 1 0 0 0 0 0 function oscillator 0: disable 1: enable must be set to 0. oscillator after e xiting stop mod e 0: disable 1: enable must be set to 0. oscillator amp capability 0:normal 1: low must be set to 0. warm-up setting register 7 6 5 4 3 2 1 0 clkwut bit symbol wthd wthw wtht (0xffff_d305) read/write r r/w r/w r r/w reset value 1 1 11 0 1 1 1 function warm-up end flag 0: warming up 1: complete warm-up operation enable 0: no w arm-up 1: enable w arm-up operation oscillator warm-up time 00:2^8 clock cycles 01:2^12 clock cycles 10:2^14 clock cycles 11:2^16 clock cycles note 1: the warm-up time set in the wtht field is counted using the fosc clock. note 2: when the wthw bit is set to 1, the warm-up time set in the wtht field is automatically inserted before clock oscillation is started. at power-on, if a reset state is released without waiting for 2^16 clock cycles, the internal circuits may not be initialized properly. note 3: during the warm-up period, no clock is supplied to the internal circuits. tmp19a71 5-5
tmp19a71 mode switch register 7 6 5 4 3 2 1 0 clkspd bit symbol ss (0xffff_d306) read/write r/w w r/w r reset value 1 00 1 0 0 0 0 function must be set to 1. standby mode (note 1) 00: normal mode 01: stop mode 10: reserved 11: idle (halt) mode must be set to 1. must be set to 0. note 1: the clkspd.ss field selects the standby mode in combination with the rp bit of cp0?s status register, as shown in the table below. the x mark indicates that the wait instruction cannot be used in that mode. clkspd.ss halt doze rp=0 rp=1 normal 00 x x stop 01 stop x reserved 10 x x idle 11 halt doze note 2: each time the tmp19a71 is placed in a standby mode, set the clkspd.ss field before executing the wait instruction. the wait instruction should not be executed successively. note 3: to set the clkspd.ss field to a value other than 00, be sure to set 0x5a5a and 0xf0f0 to the clkact register ex clusively to enable the clkspd.ss setting. if other clock generator registers are set at the same time, the settings may not be reflected correctly. note 4: this register does not support bit manipulation instructions. tmp19a71 5- 6
tmp19a71 clock gear control register 7 6 5 4 3 2 1 0 clkprsc bit symbol prs1 prs2 (0xffff_d307) read/write r/w r reset value 00 000 0 0 0 function system clock (fsys) 00: 1/2 frequency 01: 1/4 frequency 10: 1/8 frequency 11:reserved imclk clock 000: 1/2 frequency 010: 1/3 frequency 100: 1/4 frequency 110: 1/5 frequency others: reserved note: before changing the system clock setting, make sure that all peripheral functions are stopped. 5.3.3 interrupt registers nmi setting register 7 6 5 4 3 2 1 0 clknmi bit symbol nmisen nmibe (0xffff_d310) read/write r/w r reset value 00 0 0 0 0 0 0 function nmi sensitivity 00: prohibited 11: both edges 01: rising edge 10: falling edge c l k n m i setting enable 0: enable 1: disable note 1: setting this register causes the nmibe bit to be set to 1, disabling any subsequent writes to this register until a reset is applied. note 2: to use nmi, appropriate settings must be made in the relevant port registers. for details, see 8. i/o port s?. int0 setting register 0 7 6 5 4 3 2 1 0 clkw0 bit symbol D D D D w0we (0xffff_d312) read/write r/w r reset value 0 0 0 0 0 0 0 0 function must be set to 0. must be set to 0. must be set to 0. must be set to 0. int0 interrupt t ype 0: typical interrupt 1: wake-up signaling note: the w0we bit must be set to 1 to use int0 as the wake-up signaling to take the tmp19a71 out of stop mode. tmp19a71 5-7
tmp19a71 int0 setting register 1 7 6 5 4 3 2 1 0 clkint0 bit symbol i0sen (0xffff_d31a) read/write r/w r reset value 000 0 0 0 0 0 function int0 sensitivity 001: rising edge 010: falling edge 011: both edges 101: high level 110: low level others: disable int1 setting register 7 6 5 4 3 2 1 0 clkint1 bit symbol i1sen i1ki (0xffff_d31b) read/write r/w r r/w r reset value 000 0 0 0 0 0 function int1 sensitivity 001: rising edge 010: falling edge 011: both edges 101: high level 110: low level others: disable int1 interrupt t ype 0: typical interrupt 1: wake-up signaling note: the i1ki bit must be set to 1 to use int1 as the wake-up signaling to take the tmp19a71 out of stop mode. int2 setting register 7 6 5 4 3 2 1 0 clkint2 bit symbol i2sen i2ki (0xffff_d31c) read/write r/w r r/w r reset value 000 0 0 0 0 0 function int2 sensitivity 001: rising edge 010: falling edge 011: both edges 101: high level 110: low level others: disable int2 interrupt t ype 0: typical interrupt 1: wake-up signaling note: the i2ki bit must be set to 1 to use int2 as the wake-up signaling to take the tmp19a71 out of stop mode. tmp19a71 5- 8
tmp19a71 int3 setting register 7 6 5 4 3 2 1 0 clkint3 bit symbol i3sen i3ki (0xffff_d31d) read/write r/w r r/w r reset value 000 0 0 0 0 0 function int3 sensitivity 001: rising edge 010: falling edge 011: both edges 101: high level 110: low level others: disable int3 interrupt t ype 0: typical interrupt 1: wake-up signaling note: the i3ki bit must be set to 1 to use int3 as the wake-up signaling to take the tmp19a71 out of stop mode. tmp19a71 5-9
tmp19a71 5.3.4 reset registers clock generator setting register (mask-version product) 7 6 5 4 3 2 1 0 clkmisc bit symbol mswdr msnmi msbc (0xffff_d30d) read/write r/w r reset value 0 0 0 0 0 00 0 function wdt r eset flag 0: no wdt res et 1: wdt res et occurred must be set to 0. must be set to 0. nmi source flag 00: external pin 01: wdt 10: bus error (store) cg access flag 0: access enabled 1: access disabled note 1: bits 7 to 5 of the clkmisc register are not init ialized by a wdt reset; they are initialized by an external reset. note 2: the mswdr bit is not initialized by a wdt reset; it is initialized by an external reset. to clear this bit af ter a wdt reset occurred, it must be programmed to 0. note 3: the msbc bit indicates whether or not new settings can be made to the cg registers. when msbc = 1, the set tings in the cg registers are in the middle of being changed after the clkact register is set. the msbc bit must be cleared to 0 before new values can be written to the cg registers. clock generator setting register (flash-version product) 7 6 5 4 3 2 1 0 clkmisc bit symbol mscw msfr mswdr D D msnmi msbc (0xffff_d30d) read/write r/w r reset value 0 0 0 0 0 00 0 function reset type 0: power- on reset 1: normal res et flash reset by wdt or external reset 0: enable 1: disable wdt reset flag 0: no wdt res et 1: wdt res et occurred must be set to 0. must be set to 0. nmi source flag 00: external pin 01: wdt 10: bus error (store) cg access flag 0: access enabled 1: access disabled note 1: bits 7 to 5 of the clkmisc register are not initialized by a normal reset; they are initialized by a power-on reset. note 2: the mswdr bit is not initialized by a normal reset; it is initialized only by a power-on reset. to clear this bit after a wdt reset occurred, it must be programmed to 0. note 3: the mscw bit is not initialized by a normal rese t; i t is initialized only by a power-on reset. this bit can be used as a flag to indicate whether a power-on or normal reset occurred by programming this bit to 1 after a power-on reset. this bit is not automatically set to 1 by a normal reset. note 4: the msbc bit indicates whether or not new settings can be made to the cg registers. when msbc = 1, the set tings in the cg registers are in the middle of being changed after the clkact register is set. the msbc bit must be cleared to 0 before new values can be written to the cg registers. note 5: when the msfr bit is set to 1, the flash rom is not initialized by an external or wdt reset. to program or erase t he flash rom, this bit should be set to 0. tmp19a71 5- 10
tmp19a71 6. watchdog timer (wdt) the tmp19a71 contains a watchdog timer (wdt). the wdt is used to regain control of the system in the event of software system lockups due to spurious noises, etc. when a watchdog timer time-out occurs, the wdt generates a nonm askable interrupt (nmi) or a reset exception to the tx19a core processor. 6.1 operational overview the wdt can be programmed to generate a reset or nmi upon time-out. when nmi is selected, a reset occurs upon counter overflow. 6.1.1 generating an nmi (wdmod.rescr = 0) if the wdt counter is not cleared within the time-out period set in the wdmod.ftp field, the wdt generates an nmi upon time-o ut. then, the wdt continues counting. if the 23-bit binary counter is not cleared before it overflows (about 300 ms with imclk = 28 mhz), the wdt generates a reset exception. this causes the wdt to be initialized and start counting again with the default setting. note: after an nmi occurs, save necessary data on the stack and wait for an overflow reset. reset by wdt overflow wdt starts counting nmi generated wdmod.ftp figure 6.1.1 wdt operation when wdmod.rescr=0 6.1.2 generating a reset (wdmod.rescr = 1) if the wdt counter is not cleared within the time-out period set in the wdmod.ftp field, the wdt generates a reset exception upon time-out. a reset exception causes the wdt to be initialized and start counting again with the default setting. reset, causing wdt to be cleared and start counting again wdt starts counting wdmod.ftp figure 6.1.2 wdt operation when wdmod.rescr=1 tmp19a71 6-1
tmp19a71 6.2 register description the wdt is controlled by two control regi sters (wdmod, wdcr) and a counter (wdcnt), as shown in table 6.2.1 . table 6.2.1 wdt register map address number of bit s mnemonic register name 0xffff_c830 16 8 wdmod (l) watchdog timer mode register (low) 0xffff_c831 8 (wdmodh) (watchdog timer mode register high) 0xffff_c834 8 wdcr watchdog timer control register 0xffff_c838 16 wdcnt watchdog timer count register note: although the wdmod register is a 16-bit register, the lower 8 bits (wdmodl) and upper 8 bits (wdmodh) can be accessed separately. 6.2.1 watchdog timer mode register (wdmod) watchdog timer mode register 7 6 5 4 3 2 1 0 bit symbol D ftp D wden D rescr read/write r r/w r/w reset value 0 010 0 1 0 0 function can be read as 0. time-out period 000: 2^12 (about 0.15 ms at imclk=28 mhz) 001: 2^13 (about. 0.29 ms at imclk=28 mhz) 010: 2^14 (about 0.59 ms at imclk=28 mhz) 011: 2^15 (about 1.2 ms at imclk=28 mhz) 100: 2^16 (about 2.3 ms at imclk=28 mhz) 101: 2^19 (about 18.7 ms at imclk=28 mhz) 110: 2^21 (about 74.9 ms at imclk=28 mhz) 111: 2^22 (about 150 ms at imclk=28 mhz) must be set to 0. wdt enable 0: disable 1: enable must be set to 0. reset type 0: nmi upon time-out 1: reset exception upon time-out 15 14 13 12 11 10 9 8 bit symbol D D D D D D read/write r/w r r/w reset value 0 0 0 0 0 000 function must be set to 0. must be set to 0. must be set to 0. can be read as 0. can be read as 0. wdmod(l) (0xff ff_c830) (wdmodh) (0xff ff_c831) note: do not change bits other than the wden bit while the wdt is operating. tmp19a71 6-2
tmp19a71 (1) first time-out pe riod (wdmod.ftp) this 3-bit field determines the duration of th e wdt time-out interval. upon reset, the ftp field is initialized to 010. possible time-out intervals are shown in the register table. (2) wdt enable (wdmod.wden) upon reset, the wden bit is set to 1, enabling the wdt. to disable the wdt, the cl earing of the wden bit must be follow ed by a write of a special disable code (b1h) to the wdcr register. this prevents a ?lost? program from disabling the wdt operation. the wdt can be re-enabled simply by setting the wden bit. (3) wdt res et (wdmod.rescr) when rescr=1, a reset exception is generated and the wdt is initialized upon wdt time-out. when rescr=0, an nmi is generated upon wdt time-out and then a reset exception is generated upon counter overflow. tmp19a71 6-3
tmp19a71 6.2.2 watchdog timer control register (wdcr) this register is used to disable the wdt and to clear the wdt binary counter. watchdog timer control register 7 6 5 4 3 2 1 0 bit symbol D read/write w reset value ? function b1h : wdt disable code 4e h: wdt clear-count code wdcr 0xff ff_c834 wdt disable and clear -count 0xb1 disable code 0x4e clear-count code others invalid note: this register does not support bit manipulation instructions. ? ? ? disabling the wdt the wdt can be disabled by clearing the wdmod.wden to 0 and then writing the disab le code (b1h) to the wdcr register. at this time, the counter value is maintained. before enabling the wdt again, clear the counter by writing the clear-count code (4eh). wdmodl ? ? ? ? ? 0 ? ? clear the wden bit to 0. wdcr 1 0 1 1 0 0 0 1 write the disable code (b1h) to the wdcr. enabling the wdt the wdt can be enabled simply by setting the wden bit in the wdmod to 1. clearing the wdt counter writing the clear-count code (4eh) to the wdcr resets the binary counter to 0. the count ing process begins again. wdcr 0 1 0 0 1 1 1 0 write the clear-count code (4eh) to the wdcr. watchdog counter register 7 6 5 4 3 2 1 0 bit symbol D read/write r reset value 0 function 15 14 13 12 11 10 9 8 bit symbol D read/write r reset value 0 function bits 22 to 7 of the wd t counter value can be read. wdcnt 0xffff_c838 tmp19a71  6-4
tmp19a71 tmp19a71 7-1 7. exceptions/interrupts 7.1 overview tmp19a71 has exceptions of 15 types incl uding nonmaskable interrupt (nmi) and 49 maskable interrupt sources as listed below. ? gereral exceptions reset exception nonmaskable interrupt (nmi) exception address error exception (instruction fetch) address error exception (load/store) bus error exception (instruction fetch) bus error exception (data access) coprocessor unusable exception reserved instruction exception integer overflow exception trap exception system call exception breakpoint exception ? debug exceptions single step exception debug breakpoint exception ? interrupts maskable software in t errupts (2 sources) maskable hardware interrupts (37 internal sources and 10 external sources) tmp19a71 can process not only interrupt requests from on-chip peripheral hardware and ext ernal sources but also exceptions forcibly as measures of notification of error conditions arising in execution of general instructions. by using the register bank called "shadow register set" newly implemented in the tx19a proc essor core, it is now unnece ssary to save the general-purpose register (gpr) contents elsewhere upon interrupt response thus leading to very fast interrupt response. interrupt requests can be nested according to pr ogr ammable priority of seven levels. it is also possible to mask interrupt requests of priority levels lower than the specified mask level.
tmp19a71 tmp19a71 7-2 7.2 exception vectors an exception vector address is the entry address of a routine that handles an exeption. reset and nonmaksable interrupt exceptions are ve ctored to address 0xbfc0_0000. a debug exception is vectored to 0xbfc0_0480 when the ejtag proben signal is 0 and 0xff20_0200 when the ejtag proben signal is 1 according to the internal signal value of proben.values of other exceptions may be various depending on the bev bit of the status register and the iv bit of the cause register belonging to the system control coprocessor (cp0). table 7.2.1 exception vector table (virtual addresses) exception type bev=0 bev=1 reset, nmi 0xbfc0_0000 0xbfc0_0000 debug exception (en=0) 0xbfc0_0480 0xbfc0_0480 debug exception (en=1) 0xff20_0200 0xff20_0200 interrupt (iv=0) 0x8000_0180 0xbfc0_0380 interrupt (iv=1) 0x8000_0200 0xbfc0_0400 other general exceptions 0x8000_0180 0xbfc0_0380 note 1 : when exception vector addresses reside in the on-chip rom, the bev bit of the cp0 status register must be set to 1. tmp19a71 has no external bus interface, so status.bev=0 is not allowed. note 2 : to assign different exception vector addresses for interrupts and other general exceptions, set the iv bit of t he cp0 cause register to 1. 7.3 reset exception a reset exception occurs when an external reset pin is driven low or the wdt counts to its reset value. as a reset exception occurs, on-chip peripheral registers (note 1) and cp0 registers are initialied, and a control jumps to the exception vector address 0xbfc0_0000. upon a reset exception, the pc value is stored in the cp0 errorepc register. when a reset exception occurs, the erl bit of th e cp0 st atus register is set to 1, disabling interrupts. to use interrupts, the erl bit must be cleared to 0 in the startup routine (reset exception handler) or by other means. for a detailed description of reset exception handling, refer to the chapter exception hand ling reset exception in the 32-bit tx19 system risc tx19 family architecture manual. note 1 : in the flash-version product, some on-chip peripheral registers are not initialized by a reset exception; these registers are initialized only by the internal power-on reset signal that is generated at power-on. note 2 : in the mask-version product, some on-chip registers are not initialized by a reset exception caused by the wd t; these registers are initialized only by a reset exception via an external reset pin.
tmp19a71 tmp19a71 7-3 7.4 nonmaskable interrupt (nmi) a nonmaskable interrupt (nmi) occurs when an external nmi pin is asserted as specified by the nmisen field of the clknmi register; the wdt counts to the nmi value; or the bus error area is accessed by a store access including dma transfer when modecr=0. when a nmi occurs, the erl and nmi bits of the cp0 status register are set to 1 and a control jumps to the exception vector address 0xbfc0_0000. the pc value at the time of an nmi is stored in the cp0 errorepc register. however, if a bus error occurs during a store instruction, a nmi exception is generated asynchronously to the instruction execution timing and the pc is stor ed not at the instruction that caused the nmi but at the instruction that is being executed when the nmi is generated. upon nmi generation, when shadow register set is enabled, sscr will be ov erwritten by the value of sscr but the register bank will not be switched because the value of sscr is not updated. the reas on why only the sscr value is updated is because it is necessary to prevent the register bank from being changed when sscr is overwritten by the value of sscr due to an eret instruction executed upon returning from nmi. the cause of nmi generation can be determined by nmiflg and of cg. a reset initializes the nmi pin (p95) as a general-purposed port. to use the nmi pin, it is nec essary to set the p9fr15 bit of the port 9 function register 1 (p9fr1) and the nmisen field of the clknmi register. for a detailed description of nmi handlin g, refer to the chapter exception handling nonmaskable interrupts of the separate volume, tx19a core architecture . 7.5 general exceptions (other than reset exception/nmi) a general exception occurs when a specific instruction such as the syscall instruction is executed or an error condition such as an illegal instruction fetch is detected. when a general exception occurs with the status.bev bit set to 1, control jumps to the exception vector address 0xbfc0_380. the cause of a general exception can be determined by the excode field of the cp0 cause register. the pc value at the time of a general exception is stored in the cp0 epc register. however, a bus error exception (data access) is generated asynchronously to the instruction execution timing so that the pc is stored not at the instruction that caused the exception but at the instruction that is being executed when the exce ption is generated. upon a general exception, when the shadow register set is enabled, sscr will be overwritten by the value of sscr but the register bank will not be switched because the value of sscr is not updated. the reason why only the sscr value is updated is because it is necessary to prevent the register bank from being changed when sscr is overwritten by the value of sscr due to an eret instruction executed upon returning from the exception. the illegal address that caused an address error exception (instruction fetch, load, store) or bus err or exception (instruction fetch, data access) is stored in the cp0 badvaddr register. for a detailed description of general exception handli ng, refer t o the chapter exception handling of the separate volume, tx19a core architecture . note 1 : no address error exception (load, store) occurs during dma transfer. in this case, error conditions can be detected by the configuration error flag (the conf bit of the csrx register) in the dmac. note 2 : a bus error exception (data access) occurs during a load instruction or a load access by dma transfer.
tmp19a71 handled by tx19a core automatically jump to the exception vector address read the cause.excode field to det ermine the cause of the exception get the address of the exce ption handler routine jump to the exception handler routine save relevant regi sters on the stack handled by user software exception handler routine (note 1) restore the saved regisers from the stack eret instruction return to the address where the exception occurred figure 7.5.1 general exception operati on (exce ptions other than reset or nmi) note 1 : general exceptions (i.e. exceptions other than reset exception or nmi) excluding trap, system call, and breakpoint exceptions indicate error conditions; they are normally handled by a reset routine. note 2 : for general exceptions (i.e. exceptions other than reset exception or nmi) excluding bus error excepti on (instruction fetch, data access), the pc value is stored in the epc register as the instruction that caused the exception. therefore, if the eret instruction is executed to resume execution from the saved pc address, the same exception may occur again. 7.6 debug exceptions debug exceptions include single-step and debug breakpoint exceptions. these exceptions are not normally used in user programs. also enabling the shadow register set will not be effective in debug exceptions. for a detailed description of debug ex c eption handling, refer to the chapter exception handling debug exception of the separate volume, tx19 core architecture . tmp19a71 7-4
tmp19a71 tmp19a71 7-5 7.7 maskable software interrupts the tmp19a71 provides two sources of maskable software interrupts (hereafter referred to as software interrupts). each software interrupt can be generated by setting the corresponding bit in the ip[1:0] field of the cp0 cause register. a software interrupt is accepted, at the fastest, 3 clock cycles after the ip[1:0] field of the cp0 caus e register is set. software interrupt requests are accepted when all the following conditions are met: ? the im [1:0] field of the cp0 st atus register is set to 1. ? the ie b it of the cp0 status register is set to 1. ? t he erl and exl bits of the cp0 status register are cleared to 0. each software interrupt can be masked by clea rin g the corresponding bit in the im[1:0] field of the cp0 status register. if a software interrupt and a hardware interrupt occur simultaneously, the hardware interrupt is given higher priority. upon software interrupts, when shadow register set is enabled, sscr will be ov erwritten by the value of sscr but the register bank will not be switched because the value of sscr is not updated. the reason why only the sscr value is updated is because it is necessary to prevent the register bank from being changed when sscr is overwritten by the value of sscr due to an eret instruction executed upon returning from the software interrupt. software interrupts are processed in a process flow shown in figure 7.7.1 . note: software interrupts are different from software set interrupts which are generated as maskable hardware interrupts to be described hereinafter. a hardware interrupt generation caused by setting the eim00 field of the imr00 register to 01 is called software set.
tmp19a71 handled b y user software set cause.ip[1:0] to 1 to generate an interrupt handled b y tx19a core automatically jump to the exception vector address read cause.ip[1:0] to determine the cause of the interrupt clear cause.ip[1:0] to 0 to clear the interrupt jump to the interrupt handler interrupt handler routine save relevant regi sters on the stack handled b y user software restore the saved registers from the stack eret instruction return to the address where the interrupt occurred figure 7.7.1 example of softwre interrupt operation note: a software interrupt is accepted, at the fastest, 3 clock cycles after the interrupt is enabled, and the pc at this moment is stored in the epc register. tmp19a71 7-6
tmp19a71 tmp19a71 7-7 7.8 maskable hardware interrupts 7.8.1 features a maskable hardware interrupt (hereinafter referred to as hardware interrupt) is interrupt request of 47 sources that can set the seven interrupt levels of priority order individually with an interrupt controller (intc). hardware interrupt requests are accepted wh e n all the following conditions are met: ? the im [4:2] field of the cp0 st atus register is set to 1. ? the ie b it of the cp0 status register is set to 1. ? t he erl and exl bits of the cp0 status register are cleared to 0. if two or more interrupt occur simultaneously, in t errupt requests are accepted according to their priority levels. if interrupt requests of the same interrupt level occur simultaneously, the interrupt is accepted in ascending order starting with that of the smallest number (see table 7.8.1 ). when a hardware interrupt request is accepted, the exl bit of the cp0 status register is set to 1 to disa ble interrupts, and the cmask field of the ilev register is automatically updated to the interrupt level of the accepted interrupt request. the ie bit of the cp0 status register remains as has been set when an interrupt request is accepted. in hardware interrupts processing, each interrupt le vel is associated with a register ba nk called shadow register set. when an interrupt request is accepted, the register bank is switched to the one whose number is the same number of corresponding interrupt level. through this mechanism, there is no need for user program to save the general-purposed register (gpr) contents elsewhere upon interrupt response, thus a faster interrupt response is ensured. to use the shadow register set, the ssd bit of the cp0 sscr register must be cleared to 0. once an interrupt request is accepted, further interrupt requests can be nested by clearing the exl bit of the cp0 status register to 0 to enable interrupts. at this time, the cmask bit of the ilev register of intc is updated to the priority level whose interrupt request has been set, thus allows only interrupt requests with higher priority levels than the one it has been accepting. for details about interrupt nesting, refer to 7.8.9 setting example of nesting interrupt. using the cmask bit of the ilev register enables masking an interrupt request of lower prio rity level than the masking level to a programmable. all interrupt requests can be us ed for triggering dma transfer. detailed operation of hardware interrupts is prov ide d below. also, refer to the chapter exception handling maskable interrupts (interrupts) of the separate volume, tx19 core architecture .
tmp19a71 tmp19a71 7-8 7.8.2 hardware interrupt sources table 7.8.1 hardware interrupt sources (1/2) interrupt number ivr[8 : 0] interrupt name interrupt source imr 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 0x000 0x004 0x008 0x00c 0x010 0x014 0x018 0x01c 0x020 0x024 0x028 0x02c 0x030 0x034 0x038 0x03c 0x040 0x044 0x048 0x04c 0x050 0x054 0x058 0x05c 0x060 0x064 0x068 0x06c 0x070 0x074 0x078 0x07c 0x080 0x084 0x088 0x08c 0x090 0x094 0x098 0x09c 0x0a0 0x0a4 0x0a8 0x0ac 0x0b0 0x0b4 0x0b8 0x0bc 0x0c0 0x0c4 0x0c8 0x0cc 0x0d0 0x0d4 0x0d8 0x0dc software set int0 reserved reserved reserved reserved int1 int2 int3 reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved intpmd0 intpmd1 intemg0 intemg1 intenc inttbcom00 inttbcom01 inttbcom10 inttbcom11 inttbcom20 inttbcom21 inttbcom30 inttbcom31 inttbe0 reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved inttx0 intrx0 inttx1 intrx1 inttx2 intrx2 inttx3 intrx3 set imr00.eim00 to 01 int0 pin --- --- --- --- int1 pin int2 pin int3 pin --- --- --- --- --- --- --- --- --- --- --- pmd0 count register (mdcnt0) match pmd1 count register (mdcnt1) match pmd0 emg input (pa6) pmd1 emg input (pb6) encoder match tb0reg0 match/tb0cnt overflow tb0reg1 match tb1reg0 match/tb1cnt overflow tb1reg1 match tb2reg0 match/tb2cnt overflow tb2reg1 match tb3reg0 match/tb3cnt overflow tb3reg1 match tmrb0 emg input (p93) --- --- --- --- --- --- --- --- --- --- --- --- --- --- uart0 transmit complete uart0 receive complete uart1 transmit complete uart1 receive complete sio2/uart2 transmit complete sio2/uart2 receive complete sio3/uart3 transmit complete sio3/uart3 receive complete imr00 (imr01) (imr02) (imr03) imr04 (imr05) (imr06) (imr07) imr08 (imr09) (imr10) (imr11) imr12 (imr13) (imr14) (imr15) imr16 (imr17) (imr18) (imr19) imr20 (imr21) (imr22) (imr23) imr24 (imr25) (imr26) (imr27) imr28 (imr29) (imr30) (imr31) imr32 (imr33) (imr34) (imr35) imr36 (imr37) (imr38) (imr39) imr40 (imr41) (imr42) (imr43) imr44 (imr45) (imr46) (imr47) imr48 (imr49) (imr50) (imr51) imr52 (imr53) (imr54) (imr55)
tmp19a71 tmp19a71 7-9 table 7.8.2 hardware interrupt sources (2/2) interrupt number ivr[8 : 0] interrupt name interrupt source imr 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 0x0e0 0x0e4 0x0e8 0x0ec 0x0f0 0x0f4 0x0f8 0x0fc 0x100 0x104 0x108 0x10c 0x110 0x114 0x118 0x11c 0x120 0x124 0x128 0x12c 0x130 0x134 0x138 0x13c 0x140 0x144 0x148 0x14c 0x150 0x154 0x158 0x15c 0x160 0x164 0x168 0x16c 0x170 0x174 0x178 0x17c intdma0 intdma1 intdma2 intdma3 intdma4 intdma5 intdma6 intdma7 reserved reserved reserved reserved intad0 intadhp0 intadm0 intad1 intadhp1 intadm1 int4 int5 int6 int7 int8 int9 reserved reserved reserved reserved inttbcap00 inttbcap01 inttbcap10 inttbcap11 inttbcap20 inttbcap21 inttbcap30 inttbcap31 reserved reserved reserved reserved dma0 transfer complete dma1tranfer complete dma2 transfer complete dma3 transfer complete dma4 transfer complete dma5 transfer complete dma6 transfer complete dma7 transfer complete --- --- --- --- adc0 conversion complete adc0 highest-priority conversion complete adc0 conversion value compare adc1 conversion complete adc1 highest-priority conversion complete adc1 converson value compare int4 pin int5 pin int6 pin int7 pin int8 pin int9 pin --- --- --- --- tb0cap1 capture tb0cap0 capture tb1cap1 capture tb1cap0 capture tb2cap1 capture tb2cap0 capture tb3cap1 capture tb3cap0 capture --- --- --- --- imr56 (imr57) (imr58) (imr59) imr60 (imr61) (imr62) (imr63) imr64 (imr65) (imr66) (imr67) imr68 (imr69) (imr70) (imr71) imr72 (imr73) (imr74) (imr75) imr76 (imr77) (imr78) (imr79) imr80 (imr81) (imr82) (imr83) imr84 (imr85) (imr86) (imr87) imr88 (imr89) (imr90) (imr91) imr92 (imr93) (imr94) (imr95) note1: although imrxx is a 32-bit register, it is accessible by 8-bit or 16-bit one. i.e. making imr00 be imr00/imr01/imr02/imr03 enables 8-bit access. note2: reserved is a reserved area for expansion. it is recommended to set the same value as initial, ?0x00? to imr register of a reserved area.
tmp19a71 7.8.3 detection of interrupt requests an interrupt request detection varies by a source as shown in table 7.8.3 . all interrupt requ ests, after being detected, are sent to the intc for priority arbitration and then sent to the tx19a core processor, as illustrated in figure 7.8.1 . for a detection level that can be used by each interrupt source, refer to table 7.8.5 . table 7.8.3 detecting part of interrupt request interrupt type detecting part interrupt notification route (1) external pin interrupt int0 to int3 cg portt cg (detection) intc (arbitration) tx19a core (2) external pin interrupt int4 to int9 intc port intc (detection/arbitration) tx19a core (3) emergency stop interrupt intemgx port pprt (detection) pmd intc (arbitration) tx19a core (4) emergency stop interrupt inttbe0 port port (detection) intc (arbitration) tx19a core (5) other interrupts intc peripheral hardware intc (detection/arbitration) tx19a core external pin interrupt int0 to int3 tx19a core cg intemgx pmd emg detection cir cuit (port) irc emergency stop interrupt intemgx/inttbe0 inttbe0 other interrupt figure 7.8.1 notification route of interrupt tmp19a71 7-10
tmp19a71 tmp19a71 7-11 7.8.4 interrupt arbitration 1. se ven levels of interrupt priority the intc can set seven levels of interrupt pr iority individually for each interrupt source. the ilxx field of the imrxx register is used to set priority of each interrupt source. the larger the number of interrupt level is set, the higher the priority becomes. when the value is ?000? (interrupt level = 0), the source does not eneble the interrupt. and, the source of an interrupt level 0 is not stored. 2. interru pt level notification when an interrupt request occurs, the intc compares the priority level of the request int errupt with the mask level set in the cmask field of the ilev register. when an interrupt request has a higher priority level than that of the mask level, the intc sends the interrupt request to the tx19a core processor. if two or more interrupt requests occur si multaneously, the intc sends the interrupt requ est in accordance with the established pr iorities. if two or more interrupt requests having the same priority level occur simultaneously, the intc sneds the interrupt request in ascending order starting from the smallest number (see table 7.8.1 ). if another interrupt request is made from th e same interrupt source before the previous interrupt request is cleared, the in tc ignores the second interrupt request. 3. intc regist er update when tx19a core accepts an interrupt request, its priority level is stored in the cm ask field of the ilev register and the corresponding vector value is set to the ivr register. cmask/ivr once set is not updated until ivr is read or sent to the core even though an interrupt request of higher level occurs. note: before changing the ilev value, be sure to read the ivr value. if the ilev value is changed without reading the ivr value, an unexpected interrupt may occur. 7.8.5 hardware interrupt operation when a hardware interrupt is generated, tx 19a core performs the following operations and a control jumps to the exception vector address according to the bev bit of the cp0 status register and the iv bit of the cp0 cause register (see table 7.2.1 ). 1. t he exl bit of the cp0 status register is set to 1. 2. the pc va lue upon an interrupt generation is stored in the cp0 epc register. 3. whe n shadow register set is enabled (cp0 register sscr =0), cp0register sscr is updated, thus a register bank of the same number as an interrupt level becomes effective. 4. t he cmask and pmaskx fields of the ilev register of the intc are updated to set the interrupt mask level to the priority level of the accepted interrupt. 5. bits 0 t o 8 of the ivr register of the intc are set to the value corresponding to the accepted interrupt as shown in table 7.8.1 .
tmp19a71 when an interrupt occurs, automatically jump to the corresponding exc epti o n v ect o r addr ess read ivr to generate an interrupt vector address handled b y tx19a core handled b y user software clear the interrupt source in iclr read the interrupt handler address from the interrupt vector jump to the interrupt handler interrupt handler routine set ilev.mlev=0 to restore the mask level save relevant registers on the stack (note) restore the saved register s from the stack (note) eret instruction return to the address where the interrupt occurred figure 7.8.4 basic operation sample of hardware interrupt note: tx19a core can automatically save the most part of a general-purposed register by using shadow register set (cp0 register sscr=0). tmp19a71 7-12
tmp19a71 tmp19a71 7-13 7.8.6 interrupt initial settings in section 7.8.6.1, the initial settings commo n to all interrupts rega rdless of sources and in section 7.8.6.2, the initial settings specific to each interrupt source are described, both as necessary settings be fore using interrupts. 7.8.6.1 initial settings common to all interrupts the following settings must be made in order to use interrupts. 1. set th e im[4:2] field of the cp0 status register to 111. 2. set the bas e address of the interrupt vector table in bits 9 to 31 of the intc ivr register. 3. set an int errupt handler address for a respec tive interrupt source to the address, the sum of a base address of interrupt vector table and ivr[8:0] by interrupt source. programming example for the above 1.: us ing exeption vector address 0xbfc00400 lui r2,0x1040 ; cu0=1 ,bev =1 (r2 =0x1040_xxxx) addiu r2,r2,0x1c00 ; im4,im3,im2 =1 (r2 =0x1040_1c00) mtc0 r2,r12 programming example for the above 2.: using vectort able as a label of the interrupt vector table lui r3,hi(vectortable) addiu r3,r3,lo(vectortable) ; r3 = vectortable address lui r2,hi(ivr) ; r2 =0xff ff_xxxx (upper 16 bits of address in ivr) sw r3,lo(ivr)(r2) ; set vectortable address in ivr[31:9] programing example for the above 3.: using address 0xbfc20000 as a base address of the interrupt vector table _vectortable section code isa32 abs=0xbfc20000 vectortable: dw _swint ; 0 -- - software interrupt dw _int0 ; 1 -- - int0 dw _researved ; 2 --- reserved dw _researved ; 3 --- reserved dw _researved ; 4 --- reserved dw _researved ; 5 --- reserved dw _int1 ; 6 -- - int1 dw _int2 ; 7 -- - int2 dw _int3 ; 8 -- - int3 dw _researved ; 9 --- reserved note: these examples assume the use of a toshiba assembler. when using a third-party assembler, modify them as necessar y to avoid syntax errors.
tmp19a71 tmp19a71 7-14 7.8.6.2 initial settings specific to each interrupt source the registers that must be set for using an interrupt varies by sources shown below: table 7.8.5 interrupt detection and setting register interrupt type setting regiser support ed int errupt sensitivity settings (1) external pin interrupts int0 to int3 pxier (port) pxfr (port) clkintx (cg) imrxx (intc) programmable as low level, high level, falling edge, or rising edge sensitive through the ixsen field of the clkintx register in the cg. in the intc, the eimxx field of the imrxx register must be set to falling edge or low level according to the setting made in the cg. (2) external pin interrupts int4 to int9 pxier (port) pxfr (port) imrxx (intc) programmable as low level, high level, falling edge, or rising edge sensitive through the eimxx field o f the imrxx register in the intc. (3) emergency stop interrupts intemgx pxier (port) pxfr (port) pxecr (port) emgcrx (pmd) imrxx (intc) programmable as low level, high level, falling edge, or rising edge sensitive through the erm x field of the pxecr register in the port unit. in the intc, the eimxx field of the imrxx register must be set to falling edge. (4) emergency stop interrupt inttbe0 p9ier (port) p9fr2 (port) p9ecr (port) imr33 (intc) programmable as low level, high level, falling edge, or rising edge sensitive through the erm9 field of t he p9ecr r egister in the port unit. in the intc, the eim33 field of the imr33 register must be set to falling edge or low level. (5) other interrupts imrxx (intc) must always be set as falling edge sensitive. note: in level detection, a value is checked at internal clock timing each time. an edge is detected by comparing a previous value with a current value at internal clock timing. 1. ext ernal pin interrupts, int0 to int3 ? in the p ort unit, set the pxier register to enable input (see 7. port function). ? in the p ort unit, set int0 to int3 as the pin function to the pxfr register (see 7. port function). ? in the cg, set interrupt sensitivity in the ixsen field of the clkintx register (see 5.3.3 interrupt registers). ? in the cg, set enable/disable of standby cancel in the ixki bit of the clkintx register (see 5.3.3 interrupt registers). ? in the int c, set the eimxx field of the imrxx register to specify the sensitivity of the interrupt signal sent from the cg. when rising/falling edge is selected in the clkintx.ixsen, set 10 to the imrxx.eimxx to select falling edge. when high/low level is selected in the clkintx.ixsen, set 00 to the imrxx.eimxx to select low level (see 7.8.10 register ). note 1: to write to the clkintx register, it is necessary to write 0x5a5a and then 0xf0f0 in the cgact register. note 2: to initialize an interrupt, follow the interrupt detection route indicated in table 7.8.3 and make the interrupt enable with the cp0 register. if any different setting order is used, an unexpected interrupt may be generated. so, be sure to clear interrupt sources before setting inte rrupt enable. similarly, to disable an interrupt, make the interrupt disable with the cp0 register and then set the registers accordingly in the reverse order of interrupt detection route.
tmp19a71 tmp19a71 7-15 ? setting example: using the external pin interrupt int3 for waking up from stop mode (rising edge) status =?0? ; disable interrup ts p6ier =?0? ; enable port inp ut p6fr =?1? ; configure po rt as int3 clkint3 =?010? ; set int3 as falling edge sensitiv e clkint3 =?1? ; set int3 as st op wakeup signal clkact =?0x5a5a? ?0xf0f0? ; enable cg register settings imr08 =?10? ; set int3 as falling edge sensitive iclr =?0x020? ; clear int 3 interrupt request imr08 =?101? ; set int3 inte rrupt level to 5 ilev/ =?1?/?xxx? ; set mask level t o ?xxx? (set simultaneously with ilev sync instruction ; s tall until interrupt settings take effect status =?1? ; enable interrupt s ? setting example: using the exte rnal pin interrupt int3 for making it disable status =?0? ; disable interrup ts imr08 =?000? ; disable int3 interrupt iclr =?0x020? ; clear int 3 interrupt request 2. external pin interrupts, int4 to int9 ? in the p ort unit, set the pxier register to enable input (see 7. port function). ? in the p ort unit, set int4 to int9 as the pin function to the pxfr register (see 7. port function). ? in the int c, set the eimxx field of the imrxx register to specify the sensitivity of the interrupt signal (see 7.8.10 register ). note 1: to initialize an interrupt, follow the interrupt detection route indicated in table 7.8.3 and make the interrupt enable with the cp0 register. if any different setting order is used, an unexpected interrupt may be generated. so, be sure to clear interrupt sources before setting inte rrupt enable. similarly, to disable an interrupt, make the interrupt disable with the cp0 register and then set the registers accordingly in the reverse order of interrupt detection route. ? setting example: using the external pin interrupt int4 as h level status =?0? ; disable interrup ts p6ier =?0? ; enable port inp ut p6fr =?1? ; configure po rt as int4 imr74 =?01? ; set int4 as hig h level sinsitive iclr =?0x020? ; clear int 4 interrupt request imr74 =?010? ; set int4 inte rrupt level to 2 ilev/ =?1?/?xxx? ; set mask level t o ?xxx" (set simultaneously with ilev) sync instruction ; s tall until interrupt settings take effect status =?1? ; enable interrupt s
tmp19a71 tmp19a71 7-16 3. interrupt halted, intemg0/intemg1 for detailed setting example, refer to the section 7.12 usage note of emg input pin (p a6/pb6). ? i n the port unit, set the ermx field of pxecr register to be sensitive (see 7. port function). ? in the p ort unit, set input enable to the pxier register (see 7. port function). ? in the port unit, set emgx to the pin f unction of pxfr register (see 7. port function). ? in the pmd, set 1 to the emgen field of the emgcrx register (see 12.3.4 emg protection circuit). ? set 10 t o imrxx of intc (see 7.8.10 register ). note 1: to set pxecr of a port, set 0x55 to pxeclr of the port first and then 0xaa. note 2: to initialize an interrupt, enable the interrupt in cp0 register after setting it by following the interrupt detection routi ne as shown in table 7.8.3 . if the setting order varies, an unexpected interrupt may be generated or u nexpected transfer of emg state may be made. when setting an interrupt to enable, the interrupt sources and emg state must be cleared to 0. also be sure to set an interrupt in reverse order of the detection routine after disabling an interrupt in cp0 register when disabling an interrupt. 4. interrupt halted, inttbe0 for detailed setting example, refer to the s ection 7.9.1 usage note of emg input pin (p.93). ? in the p ort unit, set the erm9 field of the p9ecr register to be sensitive (see 7. port function). ? in the p ort unit, set input enable to the port of p9ier register (see 7. port function). ? in the p ort unit, set emg input to the pin function of p9fr register (see 7. port function). ? set 10 t o imr33 of intc (see 7.8.10 register ). note 1: to set pxecr of a port, set 0x55 to pxeclr of the port first and then 0xaa. note 2: to initialize an interrupt, enable the interrupt in cp0 register after setting it by following the interrupt detection routi ne as shown in table 7.8.3 . if the setting order varies, an unexpected interrupt may be generated or u nexpected transfer of emg state may be made. when setting an interrupt to enable, the interrupt sources and emg state must be cleared to 0. also be sure to set an interrupt in reverse order of the detection routine after disabling an interrupt in cp0 register when disabling an interrupt. 5. other hardware interrupt ? set th e peripheral hardware to use. ? set 10 t o imrxx of intc (see 7.8.10 register ). note 1: to initialize an interrupt, enable the interrupt in cp0 r egister after setting intc. to disable an interrupt, set intc after disabling it in the cp0 register.
tmp19a71 tmp19a71 7-17 7.8.7 enabling/disabling interrupts here, it is described the procedure of enabling and disabling of interrupt being programmed. 7.8.7.1 enabling interrupts to enable interrupts, all the following three cond itions must be satisfie d in addition to the settings described in 7.8.6 interrupt initial settings : ? t he erl bit of the cp0 status register is cleared to 0. ? t he exl bit of the cp0 status register is cleared to 0. ? the ie b it of the cp0 status register is set to 1. when an instruction which makes these settings is executed, interrupts are enabled and the reg ister setting takes effect after two clock cycles. the ie bit of the cp0 status register can be set to 1 in the following four ways: ? set the i e bit of the cp0 status register to 1 using the mtc0 instruction of 32-bit isa. ? set the cp0 ie r register to a value other than 0 using the mtc0 instruction of 32-bit isa (see note 1.) ? set the i e bit of the cp0 status register to 1 using the mtc0 instruction of 16-bit isa. ? ex ecute the ei instruction of 16-bit isa (see note 2.) note 1: it is recommended to use this measure when enabling an interrupt for 32-bit isa because of the code efficiency. in toshiba?s c compiler, too, this instruction is executed for __ei() intrinsic function of 32-bit isa. note 2: it is recommended to use this measure when enabling an interrupt for 16-bit isa because of the code efficie ncy. in toshiba?s c compiler, too, this instruction is executed for __ei() intrinsic function of 16-bit isa. note 3: of the above four methods, we recommend using the second or fourth because of smaller code size and faster exe cution.
tmp19a71 tmp19a71 7-18 7.8.7.2 disabling interrupts interrupts are disabled if any of the following three conditions is satisfied. when interrupts are disabled in this way, interrupt requests from interrupt sources that have been enabled in the initial setting (see 7.8.6 interrupt initial settings ) remain pending. note that the tmp19a71 does not latch int errupt requests from interrupt sources whose level is set to 0. ? t he erl bit of the cp0 status register is set to 1. ? t he exl bit of the cp0 status register is set to 1. ? t he ie bit of the cp0 status register is cleared to 0. execution of an instruction which makes these settings immediately disables interrupts and the reg ister setting takes effect after two clock cycles. the erl and exl bits of the cp0 status registrer are automatically set when an interru pt or exception occurs, and are automatically cleared when the eret instruction is executed. therefore, for disabling interrupts, we recommend using the third method, i.e., clearing the ie bit of the cp0 status register to 0. for how to disable interrupts when interrupt nesting is used, see 7.8.9 setting example of nesting interrupt . the ie bit of th e cp0 status register can be cleared to 0 in the following four ways: ? cl ear the ie bit of the cp0 status register to 0 using the mtc0 instruction of 32-bit isa. ? cl ear the cp0 ier register to 0 using the mtc0 istruction of 32-bit isa (see note 1). ? cl ear the ie bit of the cp0 status register to 0 using the mtc0 instruction of 16-bit isa. ? ex ecute the di instruction of 16-bit isa (see note 2). note 1: it is recommended to use this measure when disabling an interrupt for 32-bit isa because of the code efficiency. in toshiba?s c compiler, too, this instruction is executed for __di() intrinsic function of 32-bit isa. note 2: it is recommended to use this measure when disabling an interrupt for 16-bit isa because of the code efficie ncy. in toshiba?s c compiler, too, this instruction is executed for __di() intrinsic function of 16-bit isa. note 3: of the above four methods, we recommend using the second or fourth because of smaller code size and faster exe cution. to disable individual source of interrupt that ha s been enabled once after its level is set with imrxx of intcb (imrxx =?000?), set staus of cp0 register by following the example shown below, and then disable an interrupt source after disabling the interrupt. programming example for disabling interrupt sources individually mtc0 r0, ier ; disable interrup ts (clear status to 0) sb r0, imrxx ; disable inter rupt sources sync ; s tall until writing becomes effective mtc0 r29, ier ; enable interrupt s (set status to 1) note1: this programming example is of the time when using toshiba?s assembler. when the third-party assembler is used, programming error may occur. the program should be changed according to an assembler to use.
tmp19a71 tmp19a71 7-19 7.8.8 interrupt handling here, the detailed operation is described based on the basic flow of figure 7.8.4 . 7.8.8.1 interrupt respon se and restore 1. interrupt accepted by hardware after an interrupt request arbitration, intc se ts t he interrupt vector and interrupt level of the interrupt request accepted to ivr and ilev, respectively, to notify the tx19a processor core of the interrupt level. when the interrupt level is notified, the tx19a processor core sets 1 to status of the cp0 register to disable interrupts and saves the pc value at the interrupt generation to epc. if shadow re gister set is enabled (cp0 register sscr = 0), the processor core sets the interrupt level to sscr of the cp0 register and switches the register bank. when an interrupt is accepted, any ongoing execution is suspended and it automatically j umps to the exception vector address (for interrupts). figure 7.8.2 shows the sequence of accepting interrupts.
tmp19a71 ? set 1 to cause ? set a jump or branch instruction of pc to epc ? set 0 to cause ? set pc to epc if cause=0, then set 0xbfc0_0380 to pc if cause=1, then set 0xbfc0_0400 to pc set 0x00 to cause set 1 to status set an interrupt level to sscr yes interrupt detection branch delay within slot no jump to exception vector address 1 compared to ilev, interrupt level is higher low interru p t sus p ended status? 0 yes no the highest priority interrupt request ? yes no are both status and ?0? figure 7.8.2 s equence of interrupt accepted by hardware tmp19a71 7-20
tmp19a71 tmp19a71 7-21 2. process necessary for exception handler after an interrupt request is accepted, it au toma tically jumps to the exception handler in which the interrupt vector address is read from intc ivr, and the user program generates the address of the interrupt handler. as in the example statements presented in section 7.8.6 interrupt initial setting, an interrupt vector base address is set in the range of ivr[31:8], thus the ivr value becomes the interrupt vector address. after reading the intc ivr value, an interrupt so urce is clear ed. if the interrupt source is cleared before ivr is read, no correct value can be read because the ivr value is also cleared. programming example of exception handlers: when ex ception vector address (interrupt) is 0xbfc0_0400 vector_int section code isa32 abs=0xbfc00400 __interruptvector: lui r26,hi(ivr) lw r26,lo(ivr)(r26) ; read inter rupt vector address from ivr lui r27,hi(iclr) sh r26,lo(iclr)(r27) ; clear interr upt request lw r26,0(r26) ; read inter rupt handler address from interrupt vector jr r26 ; jump to interru pt handler nop note 1: this programming example is of the case toshiba?s assembler is used. when the third-party assembler is used, s yntax error may occur. program should be changed according to an assembler to use. 3. process necessary for interrupt handler typical tasks of the interrupt handler are to save appropriate registers and to process interrupts. if the sha dow register set is enabled (cp0 register sscr = 0), the general-purposed register values other than r26, r27, r28, an d r29 (shadow register set number 1 to 7) are automatically saved, thus user program doesn't ne ed to save them. refer to the separate volume, tx19a core architecture for details of general- purposed registers that are to be saved. generally, registers other than general-purposed registers are dependent on user programs. the status, epc , sscr, hi, lo, cause, and config va lues of the cp0 register shall be saved as appropriate. clearing statusto 0 after the saving process, nesting interrupts can be used by enabling interrupts. note 1: since general exceptions are accepted even when interrupts are disabled, it is recommended to save general-purposed registers and cp0 register that may be rewritten by general exceptions even when nesting interrupts is not to be used.
tmp19a71 tmp19a71 7-22 setting example necessary for interrupt handler sscr save on the stack ; saving sscr values (as appropriate) epc save on the stack ; saving epc values (as appropriate) status save on the stack ; saving status values (as appropriate) nop instruction ; s tall before the execution of eret instruction nop instruction ; s tall before the execution of eret instruction status =?0? ; interrupt enabled (only when nesting interrupts) note 1: after rewriting sscr of cp0 register, wait for two inst ructions to allow for register bank switching and then access to the register. 4. restore from interrupt handler to restore from an interrupt handler to the main process, restore the register saved at the hea d of the interrupt handler and set 0 to intc ilev to clear the interrupt mask level. by executing the eret instruction after all the restorings are completed, status of the cp0 register is cleared to 0 and the epc address is restored in pc for resuming the main process. when shadow register set is sensitive (cp0 register sscr = 0), sscr is updated by the eret instruction, and the previous number of shadow register set is restored automatically, thus the general-purposed registers saved in the register bank is also automatically restored. if nesting interrupts are used, it is necessary to set 1 to status of the cp0 register befor e restoring to disable interrupts. setting example of restoring from interrupt handler status =?1? ; interru pt disabled (only when nesting interrupts) ilev =?0? ; restore the m ask level by one sync instruction ; s tall until the mask level is restored sscr saved sscr ; restore sscr values (as appropriate) nop instruction ; s tall until sscr is switched nop instruction ; s tall until sscr is switched epc saved epc ; restore epc values (as appropriate) status saved status ; restore status values (as appropriate) nop instruction ; s tall before executing eret instruction nop instruction ; s tall before executing eret instruction eret instruction ; s tatus =?0?, pc epc, sscr sscr nop instruction ; s tall after eret instruction (only for tmp19a70) note 1: after rewriting sscr of cp0 register, wait for two inst ructions to allow for register bank switching and then access to the register. note 2: do not access cp0 register two instructions prior to the execution of eret instruction. note 3: after eret instruction execution, nop instruction must be set (only for tmp19a70).
tmp19a71 tmp19a71 7-23 7.8.9 setting example of nesting interrupt nesting interrupt is the processing of the interrupt request of higher priority during the processing of some ot her interrupts. tmp19a71 can perform nesting interrupt because intc arbitrates the priority of interrupts. when an interrupt request is accepted, ilev of intc is automatically updated to the interrupt leve l of the interrupt accepted, so that it can be arbitrated according to the priority preset by the user program. 1. additional processes required for nesting interrupts when an interrupt is accepted, 1 is set to th e statu s of the cp0 register, and interrupt becomes disabled. in order to allow nesting interrupt s, it is necessary to save the registers that could be overwritten by the second and the fo llowing interrupts before enabling the nesting interrupt process. for this purpose, in addition to the typical exception handler and interrupt handler processes, save the fo llowing registers befo re setting 0 to status of the cp0 register and then enable interrupts. cp0 registers that must be saved: ? epc ? sscr note1: some of the registers are automatically saved and restored by using interrupt functions of toshiba?s c compilier. for details, refer to the additional document of tx19 toshiba c compiler, tx19a c compiler reference . 2. additional restoration r equi red for nesting interrupts before restoring registers in the restoration from interrupts, it is necessary to disable interrupts in the wa y described in 7.8.7.2 inte rrupt disabled. this is to prevent a restored register value from being corrupted by nesting interrupts. the eret instruction automatically clears status of the cp0 register to 0. therefore, by setting 1 to status of the cp0 register to disable interrupts in the restoration, it is possible to re store automatically from the interrupt which is in interrupts enabled state. 3. proper use of status and status while there is no significant distinctio n b etween the status and status parameters, status is automatically set to 1 upon interrupt generation and cleared to 0 by the eret instruction automatically. in saving and restoring register values at the top and end, where interrupts have to be disabled, status controlled by hardware is normally used. status is used for other general in terrupt enabled/disabled control functions. a control flow of interrupt enabled/disabled is described in sect ion 7.8.9.1 interrupt control for nesting interrupt.
tmp19a71 status =1 interrupt generation status =1 eret instruction status =1 7.8.9.1 interrupt control for nesting interrupt save process restore process nesting interrupt enabled status status interrupt enabled interru p t enabled interrupt enabled status =0 figure 7.8.3 interrupt enabled/disabled of nesting interrupt control 1. status=1 enabling interrupts be comes possible by setting 1 to status of cp0 register in the condition that status of cp0 register is 0. this pr ocess shall be optionally set by software as appropriate. 2. interrupt generation as interrupts be generated, 1 is automatically set to status of cp0 register, and the interrupt becomes disabled. this is processed automatically by hardware. 3. status=0 to enable nesting interrupts, it is necessary to enable interrupts by setting 0 to status of the cp0 register after saving relevant registers. if interrupts are made enabled before saving registers, a higher priority level interrupt may corrupt the register data. this process shall be optionally set by software as appropriate. 4. nesting interrupt enabled it is an enabled interval of nesting interrupts. the interrupts of higher level than the current int errupt level (ilev) are accepted. to disable interrupts in this interval, set 0 to status of cp0 register. 5. status=1 if nesting interrupts are made enabled, it is nece ssary to to disable interr upts by setting 1 to status of the cp0 register before restoring relevant register values. if registers are saved before disabling interrupts, a higher priority le vel interrupt may corrupt the register data. this process shall be optionally set by software as appropriate. 6. eret instruction it is the instrucition to restore the state before an interrupt generation. if this instruction is ex ecuted while status of the cp0 register is set to 1, 0 is au tomatically set to the status, and interrupt becomes enabled (provided that 1 is set to status of the cp0 register). 7. status=0 disabling interrupts is possible by set ting 0 to status of cp0 register. this process shall be optionally set by software as appropriate. tmp19a71 7-24
tmp19a71 tmp19a71 7-25 7.8.10 register 7.8.10.1 register map table 7.8.6 intc register map address mnemonic register name corresponding interrupt number 0xffff_d000 imr00 interrupt mode control register 00 0 - 3 0xffff_d004 imr04 interrupt mode control register 04 4 - 7 0xffff_d008 imr08 interrupt mode control register 08 8 - 11 0xffff_d00c imr12 interrupt mode control register 12 12 - 15 0xffff_d010 imr16 interrupt mode control register 16 16 - 19 0xffff_d014 imr20 interrupt mode control register 20 20 - 23 0xffff_d018 imr24 interrupt mode control register 24 24 - 27 0xffff_d01c imr28 interrupt mode control register 28 28 - 31 0xffff_d020 imr32 interrupt mode control register 32 32 - 35 0xffff_d024 imr36 interrupt mode control register 36 36 - 39 0xffff_d028 imr40 interrupt mode control register 40 40 - 43 0xffff_d02c imr44 interrupt mode control register 44 44 - 47 0xffff_d030 imr48 interrupt mode control register 48 48 - 51 0xffff_d034 imr52 interrupt mode control register 52 52 - 55 0xffff_d038 imr56 interrupt mode control register 56 56 - 59 0xffff_d03c imr60 interrupt mode control register 60 60 - 63 0xffff_d040 imr64 interrupt mode control register 64 64 - 67 0xffff_d044 imr68 interrupt mode control register 68 68 - 71 0xffff_d048 imr72 interrupt mode control register 72 72 - 75 0xffff_d04c imr76 interrupt mode control register 76 76 - 79 0xffff_d050 imr80 interrupt mode control register 80 80 - 83 0xffff_d054 imr84 interrupt mode control register 84 84 - 87 0xffff_d058 imr88 interrupt mode control register 88 88 - 91 0xffff_d05c imr92 interrupt mode control register 92 92 - 95 0xffff_d080 ivr interrupt vector register all (0 - 95) 0xffff_d084 iclr interrupt request clear register all (0 - 95) 0xffff_d088 ilev interrupt mask level register all (0 - 95) note 1: while an interrupt mode control register (imrxx) is 32-bit register, it is accesible by 16-bit and 8-bit ones. note 2: the interrupt number to which reserved is set in table 7.8.1 hardware interrupt sources is a reserved area for exp ansion. 0, the same value as initial value shall be set to interrupt mode control registers (imrxx) of relevant interrupt number.
tmp19a71 tmp19a71 7-26 7.8.10.2 interrupt vector register (ivr) ivr is the register indicating an interrupt vector address of interrupt source generated. when an interrupt request is accepted, the correspon din g values to table 7. 8.1 is set to ivr[8:2]. ivr[31:9] are the bits readable and writable. by setting a base address of interrupt vecter, an interrupt vector address can be gene rated easily only by reading ivr. interrupt vector register 7 6 5 4 3 2 1 0 ivr bit symbol ivr7 ivr6 ivr5 ivr4 ivr3 ivr2 (0xffff_d080) read/write r reset value 0 0 0 0 0 0 0 0 function a vector of interrupt source being generated is set. 15 14 13 12 11 10 9 8 bit sy mbol ivr8 read/write r/w r reset value 0 0 0 0 0 0 0 0 function a vector of interrupt source being generate d is set. 23 22 21 20 19 18 17 16 bit sy mbol read/write r/w reset value 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit sy mbol read/write r/w reset value 0 0 0 0 0 0 0 0 function
tmp19a71 7.8.10.3 interrupt level register (ilev) ilev is the register that controls a level no t ifying interrupt requests fromintc to tx19a processor core. those under the interrupt level ilev are suspended. the top of the priority is 7 and the low est is 1. note that any interrupt of the interrupt level 0 is not suspended. when an interrupt is generated, its interrupt level is stored in , and any previously store d values are incremented in mask levels such that the previous cmask is saved in pmask0, pmask0 in pmask1, and so on. to write newly a value of , write as set 1 to . no value of can be rewritten. when 0 is set to , the interrupt mask leve l i n the register shifts back to the previous state such that pmask0 is moved to cmask, pmask1 to pmask0, and so on. to , 000 is set. to restore from an interrupt, set 0 to before executing the eret instruction. always can read 0. interrupt level register 7 6 5 4 3 2 1 0 ilev bit sy mbol D pmask0 D cmask (0xffff_d088) read/write r r/w reset value 0 000 0 000 function interrupt mask level (previous) 0 interrupt mask level (current) 15 14 13 12 11 10 9 8 bit sy mbol D pmask2 D pmask1 read/write r reset value 0 000 0 000 function interrupt mask level (previous) 2 interrupt mask level (previous )1 23 22 21 20 19 18 17 16 bit sy mbol D pmask4 D pmask3 read/write r reset value 0 000 0 000 function interrupt mask level (previous) 4 interrupt mask level (previous) 3 31 30 29 28 27 26 25 24 bit sy mbol mlev pmask6 D pmask5 read/write w r reset value 0 000 0 000 function 0:mask leve l restored 1:cmask changed interrupt mask level (previous) 6 interrupt mask level (previous) 5 note 1: this register must be accessed as a 32-bit quantity. note 2: before changing the ilev value, be sure to read the ivr value. if the ilev value is changed without reading the ivr value, an unexpected interrupt may be generated. note 3: this register does not support bit manipulation instructions. pmas pmas pmas pmas pmas pmas pmas cmas pmas pmas pmas pmas pmas pmas pmas cmas pmas pmas pmas pmas pmas pmas pmas cmas interrupt generation new interrupt level ? 000? =0 tmp19a71 7-27
tmp19a71 tmp19a71 7-28 7.8.10.4 interrupt mode control registers (imrxx) imrxx consists of: : determines the interrupt level by sources : set to starting souc es of dma transfer : determines sensit ivit y of interrupt request the interrupt numbers to which reserved is set in table 7.8.1 hardware interrupt sources are reser ved area for expansion. 0, the same as the initial value shall be set to imrxx of relevant interrupt numbers. this register can access in the quantity of 16-/8-/ 1-bit by deviding imr00 (3 2 bits) by 8 bits int o imr00/imr01/imr02/imr03. interrupt mode control registers 7 6 5 4 3 2 1 0 imr00 bit sy mbol D eim00 dm00 D il00 (0xffff_d000) read/write r r/w r r/w reset value 0 00 0 0 000 function interrupt request setting this field to 01 generates an int errupt. dmac trigger 0: disable 1:enable interrupt number 0 as dmac trigger when dm00 = 0 interrupt number 0 (software set) pr iority level 000: interrupt disabled 001-111: 1-7 when dm00 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr01) bit sy mbol D eim01 dm01 D il01 (0xffff_d001) read/write r r/w r r/w reset value 0 00 0 0 000 function sensitivity of interrupt requests is set. when sensitivity in cg is edge, 10 shall be set, and when is level, 00 shall be set. dmac trigger 0: disable 1: enable interrupt number 1 as dmac trigger when dm01 = 0 interrupt numb er 1 (int0) priority level 000: interrupt disabled 001-111: 1-7 when dm01 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr02) bit sy mbol D D D D D (0xffff_d002) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 31 30 29 28 27 26 25 24 (imr03) bit sy mbol D D D D D (0xffff_d003) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 000. must be set as 0. must be set as 000.
tmp19a71 tmp19a71 7-29 interrupt mode control registers 7 6 5 4 3 2 1 0 imr04 bit sy mbol D D D D D (0xffff_d004) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 15 14 13 12 11 10 9 8 (imr05) bit sy mbol D D D D D (0xffff_d005) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 23 22 21 20 19 18 17 16 (imr06) bit sy mbol D eim06 dm06 D il06 (0xffff_d006) read/write r r/w r r/w reset value 0 00 0 0 000 function sensitivity of interrupt requests is set. when sensitivity in cg is edge, 10 shall be set, and when is level, 00 shall be set. dmac trigger 0: disable 1: enable interrupt number 6 as dmac trigger when dm06 = 0 interrupt number 6 (int1) priority level 000: interrupt disabled 001-111: 1-7 when dm06 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr07) bit sy mbol D eim07 dm07 D il07 (0xffff_d007) read/write r r/w r r/w reset value 0 00 0 0 000 function sensitivity of interrupt requests is set. when sensitivity in cg is edge, 10 shall be set, and when is level, 00 shall be set. dmac trigger 0:disable 1: enable interrupt number 7 as dmac trigger when dm07 = 0 interrupt numb er 7 (int2) priority level 000: interrupt disabled 001-111: 1-7 when dm07 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-30 interrupt mode control registers 7 6 5 4 3 2 1 0 imr08 bit symbol D eim08 dm08 D il08 (0xffff_d008) read/write r r/w r r/w reset value 0 00 0 0 000 function sensitivity of interrupt requests is set. when sensitivity in cg is edge, 10 shall be set, and when is level, 00 shall be set. dmac trigger 0: disable 1:enable interrupt number 8 as dmac trigger when dm08 = 0 interrupt numb er 8 (int3) priority level 000: interrupt disabled 001-111: 1-7 dm08 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr09) bit sy mbol D D D D D (0xffff_d009) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 23 22 21 20 19 18 17 16 (imr10) bit sy mbol D D D D D (0xffff_d00a) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 31 30 29 28 27 26 25 24 (imr11) bit sy mbol D D D D D (0xffff_d00b) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000.
tmp19a71 tmp19a71 7-31 interrupt mode control registers 7 6 5 4 3 2 1 0 imr12 bit sy mbol D D D D D (0xffff_d00c) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 15 14 13 12 11 10 9 8 (imr13) bit sy mbol D D D D D (0xffff_d00d) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 23 22 21 20 19 18 17 16 (imr14) bit sy mbol D D D D D (0xffff_d00e) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 31 30 29 28 27 26 25 24 (imr15) bit sy mbol D D D D D (0xffff_d00f) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000.
tmp19a71 tmp19a71 7-32 interrupt mode control registers 7 6 5 4 3 2 1 0 imr16 bit sy mbol D D D D D (0xffff_d010) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 15 14 13 12 11 10 9 8 (imr17) bit sy mbol D D D D D (0xffff_d011) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 23 22 21 20 19 18 17 16 (imr18) bit sy mbol D D D D D (0xffff_d012) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 31 30 29 28 27 26 25 24 (imr19) bit sy mbol D D D D D (0xffff_d013) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000.
tmp19a71 tmp19a71 7-33 interrupt mode control registers 7 6 5 4 3 2 1 0 imr20 bit sy mbol D eim20 dm20 D il20 (0xffff_d014) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0:disable 1: enable interrupt number 20 as dmac trigger when dm20 = 0 interrupt numb er 20 (intpmd0) priority level 000: interrupt disabled 001-111: 1-7 when dm20 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr21) git s ymbol D eim21 dm21 D il21 (0xffff_d015) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 21 as dmac trigger when dm21 = 0 interrupt numb er 21 (intpmd1) priority level 000: interrupt disabled 001-111: 1-7 when dm21 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr22) bit sy mbol D eim22 dm22 D il22 (0xffff_d016) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0:disable 1: enable interrupt number 22 as dmac trigger when dm22 = 0 interrupt numb er 22 (intemg0) priority level 000: interrup t disabled 001-111: 1-7 when dm22 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr23) bit sy mbol D eim23 dm23 D il23 (0xffff_d017) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 23 as dmac trigger when dm23 = 0 interrupt num ber 23 (intemg0) priority level 000: interrupt disabled 001-111: 1-7 when dm23 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-34 interrupt mode control registers 7 6 5 4 3 2 1 0 imr24 bit sy mbol D eim24 dm24 D il24 (0xffff_d018) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 24 as dmac trigger when dm24 = 0 interrupt numb er 24 (intenc) priority level 000: interrupt disabled 001-111: 1-7 when dm24 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr25) bit sy mbol D eim25 dm25 D il25 (0xffff_d019) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 25 as dmac trigger when dm25 = 0 interrupt number 25 ( inttbcom00) priority level 000: interrupt disabled 001-111: 1-7 when dm25 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr26) bit sy mbol D eim26 dm26 D il26 (0xffff_d01a) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 26 as dmac trigger when dm26 = 0 interrupt number 26 (inttbcom01) priority level 000: interrup t disabled 001-111: 1-7 when dm26 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr27) bit sy mbol D eim27 dm27 D il27 (0xffff_d01b) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable intrrupt number 27 as dmac trigger when dm27 = 0 interrupt numb er 27 (inttbcom10) priority level 000: interrupt disabled 001-111: 1-7 when dm27 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-35 interrupt mode control registers 7 6 5 4 3 2 1 0 imr28 bit sy mbol D eim28 dm28 D il28 (0xffff_d01c) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable intrrupt number 28 as dmac trigger when dm28 = 0 interrupt numb er 28 (inttbcom11) priority level 000: interrupt disabled 001-111: 1-7 when dm28 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr29) bit sy mbol D eim29 dm29 D il29 (0xffff_d01d) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 29 as dmac trigger when dm29 = 0 interrupt numb er 29 (inttbcom20) priority level 000: interrupt disabled 001-111: 1-7 when dm29 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr30) bit sy mbol D eim30 dm30 D il30 (0xffff_d01e) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 30 as dmac trigger when dm30 = 0 interrupt numb er 30 (inttbcom21) priority level 000: interrupt disabled 001-111: 1-7 when dm30 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr31) bit sy mbol D eim31 dm31 D il31 (0xffff_d01f) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 31 as dmac trigger when dm31 = 0 interrupt numb er 31 (inttbcom30) priority level 000: interrupt disabled 001-111: 1-7 when dm31 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-36 interrupt mode control registers 7 6 5 4 3 2 1 0 imr32 bit sy mbol D eim32 dm32 D il32 (0xffff_d020) read/write r r/w r r/w reset value 0 00 0 0 000 funcion set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 32 as dmac trigger when dm32 = 0 interrupt numb er 32 (inttbcom31) priority level 000: interrup t disabled 001-111: 1-7 when dm32 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr33) bit sy mbol D eim33 dm33 D il33 (0xffff_d021) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 33 as dmac trigger when dm33 = 0 interrupt num ber (inttbe0) priority level 000: interrupt disabled 001-111: 1-7 when dm33 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr34) bit sy mbol D D D D D (0xffff_d022) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 31 30 29 28 27 26 25 24 (imr35) bit sy mbol D D D D D (0xffff_d023) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000
tmp19a71 tmp19a71 7-37 interrupt mode control registers 7 6 5 4 3 2 1 0 imr36 bit sy mbol D D D D D (0xffff_d024) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 15 14 13 12 11 10 9 8 (imr37) bit sy mbol D D D D D (0xffff_d025) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 23 22 21 20 19 18 17 16 (imr38) bit sy mbol D D D D D (0xffff_d026) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 31 30 29 28 27 26 25 24 (imr39) bit sy mbol D D D D D (0xffff_d027) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000.
tmp19a71 tmp19a71 7-38 interrupt mode control registers 7 6 5 4 3 2 1 0 imr40 bit sy mbol D D D D D (0xffff_d028) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 15 14 13 12 11 10 9 8 (imr41) bit sy mbol D D D D D (0xffff_d029) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 23 22 21 20 19 18 17 16 (imr42) bit sy mbol D D D D D (0xffff_d02a) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 31 30 29 28 27 26 25 24 (imr43) bit sy mbol D D D D D (0xffff_d02b) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000.
tmp19a71 tmp19a71 7-39 interrupt mode control registers 7 6 5 4 3 2 1 0 imr44 bit sy mbol D D D D D (0xffff_d02c) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 15 14 13 12 11 10 9 8 (imr45) bit sy mbol D D D D D (0xffff_d02d) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 23 22 21 20 19 18 17 16 (imr46) bit sy mbol D D D D D (0xffff_d02e) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 31 30 29 28 27 26 25 24 (imr47) bit sy mbol D D D D D (0xffff_d02f) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000.
tmp19a71 tmp19a71 7-40 interrupt mode control registers 7 6 5 4 3 2 1 0 imr48 bit sy mbol D eim48 dm48 D il48 (0xffff_d030) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 48 as dmac trigger when dm48 = 0 intrrupt numbe r 48 (inttx0) priority level 000: interrupt disabled 001-111: 1-7 when dm48 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr49) bit sy mbol D eim49 dm49 D il49 (0xffff_d031) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 49 as dmac trigger when dm49 = 0 interrupt numb er 49(intrx0) priority level 000: interrupt disabled 001-111: 1-7 when dm49 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr50) bit sy mbol D eim50 dm50 D il50 (0xffff_d032) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 50 as dmac trigger when dm50 = 0 interrupt numb er 50 (inttx1) priority level 000: interrupt disabled 001-111: 1-7 when dm50 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr51) bit sy mbol D eim51 dm51 D il51 (0xffff_d033) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 51 as dmac trigger when dm51 = 0 interrupt numb er 51(intrx1) priority level 000: interrupt disabled 001-111: 1-7 when dm51 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-41 interrupt mode control registers 7 6 5 4 3 2 1 0 imr52 bit sy mbol D eim52 dm52 D il52 (0xffff_d034) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 52 as dmac trigger when dm52 = 0 intrrupt numbe r 52 (inttx2) priority level 000: interrupt disabled 001-111: 1-7 when dm52 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr53) bit sy mbol D eim53 dm53 D il53 (0xffff_d035) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 53 as dmac trigger when dm53 = 0 interrupt numb er 53 (intrx2) priority level 000: interrupt disabled 001-111: 1-7 when dm53 = dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr54) bit sy mbol D eim54 dm54 D il54 (0xffff_d036) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 54 as dmac trigger when dm54 = 0 interrupt numb er 54 (inttx3) priority level 000: interrupt disabled 001-111: 1-7 when dm54 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr55) bit sy mbol D eim55 dm55 D il55 (0xffff_d037) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 55 as dmac trigger when dm55 = 0 interrupt numb er 55 (intrx3) priority level 000: interrupt disabled 001-111: 1-7 when dm55 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-42 interrupt mode control registers 7 6 5 4 3 2 1 0 imr56 bit sy mbol D eim56 dm56 D il56 (0xffff_d038) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 56 as dmac trigger when dm56 = 0 interrupt num ber 56 (intdma0) peiority level 000: interrupt disabled 001-111: 1-7 when dm56 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr57) bit sy mbol D eim57 dm57 D il57 (0xffff_d039) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 57 as dmac trigger when dm57 = 0 interrupt num ber 57 (intdma1) priority level 000: interrupt disabled 001-111: 1-7 when dm57 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr58) bit sy mbol D eim58 dm58 D il58 (0xffff_d03a) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 58 as dmac trigger when dm58 = 0 interrupt numb er 58 intdma2 priority level 000: interrupt disabled 001-111: 1-7 when dm58 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr59) bit sy mbol D eim59 dm59 D il59 (0xffff_d03b) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 59 as dmac trigger when dm59 = 0 interrupt num ber 59 (intdma3) priority level 000: interrupt disabled 001-111: 1-7 when dm59 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-43 interrupt mode control registers 7 6 5 4 3 2 1 0 imr60 bit sy mbol D eim60 dm60 D il60 (0xffff_d03c) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 60 as dmac trigger when dm60 = 0 interrupt num ber 60 (intdma4) priority level 000: interrupt disabled 001-111: 1-7 when dm60 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr61) bit sy mbol D eim61 dm61 D il61 (0xffff_d03d) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 61 as dmac trigger when dm61 = 0 interrupt numb er 61(intdma5) priority level 000: interrupt disabled 001-111: 1-7 when dm61 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr62) bit sy mbol D eim62 dm62 D il62 (0xffff_d03e) read/write r r/w r r/w reset value 0 00 0 0 000 funcion set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 62 as dmac trigger when dm62 = 0 interrupt number 62 (intdma6) pr iority level 000: interrupt disabled 001-111: 1-7 when dm62 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr63) bit sy mbol D eim63 dm63 D il63 (0xffff_d03f) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 63 as dmac trigger when dm63 = 0 interrupt numb er 63 (intdma7) priority level 000: interrupt disabled 001-111: 1-7 when dm63 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-44 interrupt mode control registers 7 6 5 4 3 2 1 0 imr64 bit sy mbol D D D D D (0xffff_d040) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 15 14 13 12 11 10 9 8 (imr65) bit sy mbol D D D D D (0xffff_d041) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 23 22 21 20 19 18 17 16 (imr66) bit sy mbol D D D D D (0xffff_d042) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0 must be set as 000. 31 30 29 28 27 26 25 24 (imr67) bit sy mbol D D D D D (0xffff_d043) read/write r r/w r r/w reset vaue 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000.
tmp19a71 tmp19a71 7-45 interrupt mode control registers 7 6 5 4 3 2 1 0 imr68 bit symbol D eim68 dm68 D il68 (0xffff_d044) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 68 as dmac trigger when dm68 = 0 interrupt numb er 68 (intad0) interrupt level 000: interrupt disabled 001-111: 1-7 when dm68 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr69) bit sy mbol D eim69 dm69 D il69 (0xffff_d045) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 69 as dmac trigger when dm69 = 0 interrupt numb er 69 (intadhp0) priority level 000: interrupt disable 001-111: 1-7 when dm69 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr70) bit sy mbol D ei70 dm70 D il70 (0xffff_d046) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 70 as dmac trigger when dm70 = 0 interrupt numb er 70 (intadm0) peiority level 000: interrupt disabled 001-111: 1-7 when dm70 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr71) bit sy mbol D eim71 dm71 D il71 (0xffff_d047) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 71 as dmac trigger when dm71 = 0 interrupt numb er 71 (intad1) priority level 000: interrupt disabled 001-111: 1-7 when dm71 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-46 interrupt mode control registers 7 6 5 4 3 2 1 0 imr72 bit sy mbol D eim72 dm72 D il72 (0xffff_d048) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 72 as dmac trigger when dm72 = 0 interrupt numb er 72 (intadhp1) priority level 000: interrupt disabled 001-111: 1-7 when dm72 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr73) bit sy mbol D eim73 dm73 D il73 (0xffff_d049) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1:enable interrupt number 73 as dmac trigger when dm73 = 0 interrupt num ber 73 (intadm1) priority level 000: interrup t disabled 001-111: 1-7 when dm73 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr74) bit sy mbol D ei74 dm74 D il74 (0xffff_d04a) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 00: level ?l? 01: level ?h? 10: rising edge 11: falling edge dmac trigger 0: disable 1: enable interrupt number 74 as dmac trigger when dm74 = 0 interrupt number 74 (int4) priority level 000: interrupt disabled 001-111: 1 1- 7 when dm74 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr75) bit sy mbol D eim75 dm75 D il75 (0xffff_d04b) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 00: level ?l? 01: level ?h? 10: rising edge 11: falling edge dmac trigger 0: disable 1: enable interrupt number 75 as dmac trigger when dm75 = 0 interr upt number 75 (int5) priority level 000: interrupt disabled 001-111: 1-7 when dm75 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-47 interrupt mode control registers 7 6 5 4 3 2 1 0 imr76 bit sy mbol D ei76 dm76 D il76 (0xffff_d04c) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 00: level ?l? 01: level ?h? 10: rising edge 11: falling edge dmac trigger 0: disable 1: enable interrupt number 76 as dmac trigger when dm76 = 0 interrupt numbe r 76 (int6) priority level 000: interrupt disabled 001-111: 1-7 when dm76 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr77) bit sy mbol D ei77 dm77 D il77 (0xffff_d04d) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 00: level ?l? 01: level ?h? 10: rising edge 11: falling edge dmac trigger 0:disable 1: enable interrupt number 77 as dmac trigger when dm77 = 0 interrupt number 77 (int7) priorityl evel 000: interrupt disabled 001-111: 1-7 when dm77 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr78) bit sy mbol D ei78 dm78 D il78 (0xffff_d04e) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 00: level ?l? 01: level ?h? 10: rising edge 11: falling edge dmac trigger 0: disable 1: enable interrupt number 78 as dmac trigger when dm78 = 0 interrupt number 78 (int8) priority level 000: interrupt disabled 001-111: 1-7 when dm78 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr79) bit sy mbol D ei79 dm79 D il79 (0xffff_d04f) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 00: level ?l? 01: level ?h? 10: rising edge 11: falling edge dmac trigger 0: disable 1: enable interrupt number 79 as dmac trigger when dm79 = 0 interrupt numbe r 79 (int9) priority level 000: interrupt disabled 001-111: 1-7 when dm79 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-48 interrupt mode control registers 7 6 5 4 3 2 1 0 imr80 bit sy mbol D D D D D (0xffff_d050) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 15 14 13 12 11 10 9 8 (imr81) bit sy mbol D D D D D (0xffff_d051) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 23 22 21 20 19 18 17 16 (imr82) bit sy mbol D D D D D (0xffff_d052) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 31 30 29 28 27 26 25 24 (imr83) bit sy mbol D D D D D (0xffff_d053) read/write r r/w r r/w reset vaue 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000.
tmp19a71 tmp19a71 7-49 interrupt mode control registers 7 6 5 4 3 2 1 0 imr84 bit sy mbol D eim84 dm84 D il84 (0xffff_d054) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 84 as dmac trigger when dm84 = 0 interrupt numb er 84 (inttbcap00) priority level 000: interrupt disabled 001-111: 1-7 when dm84 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr85) bit sy mbol D eim85 dm85 D il85 (0xffff_d055) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 85 as dmac trigger when dm85 = 0 interrupt numb er 85 (inttbcap01) priority level 000: interrupt disabled 001-111: 1-7 when dm85 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr86) bit sy mbol D eim86 dm86 D il86 (0xffff_d056) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 86 as dmac trigger when dm86 = 0 interrupt number 86 ( inttbcap10) priority level 000: interrupt disabled 001-111: 1-7 when dm86 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr87) bit sy mbol D eim87 dm87 D il87 (0xffff_d057) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 87 as dmac trigger when dm87 = 0 interrupt number 87 ( inttbcap11) priority level 000: interrupt disabled 001-111: 1-7 when dm87 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-50 interrupt mode control registers 7 6 5 4 3 2 1 0 imr88 bit symbol D eim88 dm88 D il88 (0xffff_d058) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 88 as dmac trigger when dm88 = 0 interrupt number 88 ( inttbcap20) priority level 000: interrupt disabled 001-111: 1-7 when dm88 = 1 dmac channel select 000-111: 0-7 15 14 13 12 11 10 9 8 (imr89) bit sy mbol D eim89 dm89 D il89 (0xffff_d059) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 89 as dmac trigger when dm89 = 0 interrupt number 89 ( inttbcap21) priority level 000: interrupt disabled 001-111: 1-7 when dm89 = 1 dmac channel select 000-111: 0-7 23 22 21 20 19 18 17 16 (imr90) bit sy mbol D eim90 dm90 D il90 (0xffff_d05a) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 90 as dmac trigger when dm90 = 0 interrupt number 90 ( inttbcap30) priority level 000: interrupt disabled 001-111: 1-7 when dm90 = 1 dmac channel select 000-111: 0-7 31 30 29 28 27 26 25 24 (imr91) bit sy mbol D eim91 dm91 D il91 (0xffff_d05b) read/write r r/w r r/w reset value 0 00 0 0 000 function set sensitivity of interrupt r equest. 10 must be set to it. dmac trigger 0: disable 1: enable interrupt number 91 as dmac trigger when dm91 = 0 interrupt number 91 ( inttbcap31) priority level 000: interrupt disabled 001-111: 1-7 when dm91 = 1 dmac channel select 000-111: 0-7
tmp19a71 tmp19a71 7-51 interrupt mode control registers 7 6 5 4 3 2 1 0 imr92 bit sy mbol D D D D D (0xffff_d05c) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 15 14 13 12 11 10 9 8 (imr93) bit sy mbol D D D D D (0xffff_d05d) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 23 22 21 20 19 18 17 16 (imr94) bit sy mbol D D D D D (0xffff_d05e) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000. 31 30 29 28 27 26 25 24 (imr95) bit sy mbol D D D D D (0xffff_d05f) read/write r r/w r r/w reset value 0 00 0 0 000 function must be set as 00. must be set as 0. must be set as 000.
tmp19a71 tmp19a71 7-52 7.8.10.5 interrupt request clear register (iclr) by setting ivr[8:0] of interrupt source whose re q uest is desired to clear to iclr, an interrupt request suspended can be cleared. as an interrupt request is cleared, ivr va lues also are cleared, thus no determination of interrupt sources can be made. interrupt requests must never be cleared before reading ivr values. interrupt request clear register 7 6 5 4 3 2 1 0 iclr bit sy mbol iv (0xffff_d084) read/write w reset value D D D D D D D D function set the values in ivr[8:0] of sources to the interrup ts whose request is desired to clear. 15 14 13 12 11 10 9 8 bit sy mbol D D D D D D D iv read/write r w reset value 0 0 0 0 0 0 0 D function note 1: this register must be accessed in 16 bits. note 2: regardless of sensitivity setting of imrxx of intc, which may be level ?h?/?l? or rising/faling edge, interru pt request shall be cleared to retain its interrupt source. note 3: this register is not accessible with any bit manipulation instruction. note 4: no external transfer request caused by interrupt sources of dmac is cleared. an external transfer request once accepted is not cancelled until dma transfer is executed. therefore, to clear unnecessary external transfer request, dma transfer execution, disabling interrupt in imrxx before accepting, or cancelling a starting source of dmac in imrxx is required.
tmp19a71 tmp19a71 7-53 7.8.10.6 mode control register modecr bus error exceptions are not generated by store instructions or write accesses by the dmac. by s etting a 0 in the berctl bit of the mode cr, a nmi can be generated when the bus error area is accessed by a store instruction or a write access by the dmac. mode control register 7 6 5 4 3 2 1 0 modecr bit symbol (0xffff_d400) read/write r reset value 0 0 0 0 0 0 0 0 function 15 14 13 12 11 10 9 8 bit sy mbol read/write r reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit sy mbol berctl read/write r r/w reset value 0 0 0 0 0 1 1 1 function must be set as 1. must be set as 1. bus error b y store access 0: nmi generated 1: nmi not generated 31 30 29 28 27 26 25 24 bit symbol read/write r reset value 0 0 0 0 0 0 0 0 function note: this register must be accessed as a 32-bit quantity.
tmp19a71 tmp19a71 7-54 7.9 usage note of interrupt cautions and warnings upon using interrupts are described here. a user program must be programmed, meeting the requirements below. 7.9.1 tx19a processor core ? since tmp19a71 has no external bus interface, no interrupt can be used by setting 0 to status of cp0 register. ? exc eptions cannot be disabled. note th at some of them have two types of instructions whose differences are only ge nerated exception or non-generated. use them as usage. ? soft ware sets of software interrupt and hardware interrupt sources are different interrupt source. ? place tw o nop instructions immediately after rewriting sscr of cp0 register because it takes two clocks to change a register bank. ? whe n the interrupt requests of the same level are accepted simultaneously by changing ilev, it is necessary to save in user program since register banks do not switch. ? ie r of cp0 register is only accessible from 32-bit isa. ? stack point ers (r29) needs to be set twic e since they are distinguished as shadow register set number 0 and shadow register set number from 1 to7. using shadow register set number 1 by setting 1 to sscr in main processing is the way to use a common stack pointer. in this meshod, it is necessary to save in user program because no register bank is switched even if an interrupt of level 1 is accepted. ? if an eret instruction is executed while interrupts are disabled by setting 1 to status of the cp0 register, it restores errorepc of cp0 register in main processing as a restoring address. since tx19a processor core saves the interrupt restoring address in epc, it is necessary to be careful with disabling interrupts in status. ? do n ot execuse eret instruction within two clocks after accessing status, errorepc, epc, or sscr of cp0 register. ? whe n disabling an interrupt by setting status of cp0 register, the interrupt becomes disabled at the instruct ion execution point (stage e) while the value set to the register becomes effective two clocks later. ? when e nabling an interrupt by setting st atus of cp0 register, it becomes enabled two clocks after the instruction execution point (stage e), and the value set to the register also becomes effective two clocks after the instruction execution point (stage e). ? tmp19a71 has two types of re gister number: r9 (sel6) which is accessible with 32-bit isa only and r22 (sel0) which is assc essible with 32-bit/16-bit isa. in both cases, it turns out to be the same result. to use the register number r9 (sel6) with toshiba?s c compiler, specify -tx19_sscr9 as a compiling op tion. for details, refer to the additional documents of toshiba c compiler, tx19a c compilier reference .
tmp19a71 tmp19a71 7-55 7.9.2 intc ? when there are two or more interrupt requests of the same level, the acceptance is made on a priority basis from the sour ces of the smallest interrupt number. ? interru pt sources of leve l 0 is not suspended. ? t o disable an interrupt source (interrupt level 0) individually, disable it in interrupt disabled state. ? init ial values of imrxx of intc and setting value may be different. ? ilev of intc must be accessed in 32-bit quantity. ? iclr of intc must be accessed in 16-bit quantity. ? when an in terrupt request is cleared in iclr before reading ivr value of intc, ivr value is cleared and interrupt sources cannot be distinguished. ? t o enable an interrupt, it must be set in the detection order (from outside to inside) and to disable it, in reverse of the detection order (from inside to outside). if not, unexpected interrupt may be generated or unexpected transfer of emg state may occur. to prevent such cases, interrupt so urces or emg state must be cleared before enabling interrupts. ? t o rewrite ilev values of intc, set 1 to simultaneously.
tmp19a71 tmp19a71 8-1 8. i/o ports 8.1 port 0 (p00 to p07) port 0 pins can be individually programmed to function as disc rete general-purpose i/o pins. internal data bus p0cr p0d p0ier selector p0dssr reset high/ low p0pucr s a b p00 to p07 p0d read vcc3 note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.1.1 port 0 (p00 to p07)
tmp19a71 tmp19a71 8-2 port 0 register 7 6 5 4 3 2 1 0 p0d bit symbol p0d7 p0d6 p0d5 p0d4 p0d3 p0d2 p0d1 p0d0 (0xffff_c000) read/write r/w reset value 0 0 0 0 0 0 0 0 function port 0 output data (output latch) note: when p0ier=0, the port state can be read from this register. port 0 control register 7 6 5 4 3 2 1 0 p0cr bit symbol p0cr7 p0cr6 p0cr5 p0cr4 p0cr3 p0cr2 p0cr1 p0cr0 (0xffff_c004) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: output disabled 1: output enabled port 0 input enable register 7 6 5 4 3 2 1 0 p0ier bit symbol p0ier7 p0ier6 p0ier5 p0ier4 p0ier3 p0ier2 p0ier1 p0ier0 (0xffff_c008) read/write r/w reset value 1 1 1 1 1 1 1 1 function 0: input enabled 1: input disabled port 0 drive strength register 7 6 5 4 3 2 1 0 p0dssr bit symbol p0dssr7 p0dssr6 p0d ssr5 p0dssr4 p0dssr3 p0dssr2 p0dssr1 p0dssr0 (0xffff_c00c) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: low drive capability 1: high drive capability note: the current flowing through ports should not exceed the maximum rating. port 0 pull-up control register 7 6 5 4 3 2 1 0 p0pucr bit symbol p0pucr7 p0pucr6 p0pucr5 p0pucr4 p0pucr3 p0pucr2 p0pucr1 p0pucr0 (0xffff_c014) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled
tmp19a71 tmp19a71 8-3 8.2 port 1 (p10 to p17) eight port 1 pins can be individually programme d to function as discre te general-purpose i/o pins. internal data bus p1cr p1d p1ier selector p1dssr reset low/ high p1pucr s a b p10 to p17 p1d read vcc3 note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.2.1 port 1 (p10 to p17)
tmp19a71 tmp19a71 8-4 port 1 register 7 6 5 4 3 2 1 0 p1d bit symbol p1d7 p1d6 p1d5 p1d4 p1d3 p1d2 p1d1 p1d0 (0xffff_c040) read/write r/w reset value 0 0 0 0 0 0 0 0 function port 1 output data (output latch) note: when p1ier=0, the port state can be read from this register. port 1 control register 7 6 5 4 3 2 1 0 p1cr bit symbol p1cr7 p1cr6 p1cr5 p1cr4 p1cr3 p1cr2 p1cr1 p1cr0 (0xffff_c044) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: output disabled 1: output enabled port 1 input enable register 7 6 5 4 3 2 1 0 p1ier bit symbol p1ier7 p1ier6 p1ier5 p1ier4 p1ier3 p1ier2 p1ier1 p1ier0 (0xffff_c048) read/write r/w reset value 1 1 1 1 1 1 1 1 function 0: input enabled 1: input disabled port 1 drive strength register 7 6 5 4 3 2 1 0 p1dssr bit symbol p1dssr7 p1dssr6 p1d ssr5 p1dssr4 p1dssr3 p1dssr2 p1dssr1 p1dssr0 (0xffff_c04c) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: low drive capability 1: high drive capability note: the current flowing through ports should not exceed the maximum ratings for each port pin and for all the port pins. port 1 pull-up control register 7 6 5 4 3 2 1 0 p1pucr bit symbol p1pucr7 p1pucr6 p1pucr5 p1pucr4 p1pucr3 p1pucr2 p1pucr1 p1pucr0 (0xffff_c054) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled
tmp19a71 tmp19a71 8-5 8.3 port 2 (p20 to p24) five port 2 pins can be indi vidually programmed to function as discrete general-purpose i/o pins. internal data bus p2cr p2d p2ier selector p2dssr reset low/ high p2pucr s a b p20 p24 p2d read vcc3 note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.3.1 port 2 (p20 to p24
tmp19a71 tmp19a71 8-6 port 2 register 7 6 5 4 3 2 1 0 p2d bit symbol D D D p2d4 p2d3 p2d2 p2d1 p2d0 (0xffff_c080) read/write r/w reset value 0 0 0 0 0 0 0 0 function port 2 output data (output latch) note: when p2ier=0, the port state can be read from this register. port 2 control register 7 6 5 4 3 2 1 0 p2cr bit symbol D D D p2cr4 p2cr3 p2cr2 p2cr1 p2cr0 (0xffff_c084) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: output disabled 1: output enabled port 2 input enable register 7 6 5 4 3 2 1 0 p2ier bit symbol D D D p2ier4 p2ier3 p2ier2 p2ier1 p2ier0 (0xffff_c088) read/write r/w reset value 0 0 0 1 1 1 1 1 function 0: input enabled 1: input disabled port 2 drive strength register 7 6 5 4 3 2 1 0 p2dssr bit symbol D D D p2dssr4 p2dssr3 p2dssr2 p2dssr1 p2dssr0 (0xffff_c08c) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: low drive capability 1: high drive capability note: the current flowing through ports should not exceed the maximum ratings for each port pin and for all the port pins. port 2 pull-up control register 7 6 5 4 3 2 1 0 p2pucr bit symbol D D D p2pucr4 p2pucr3 p2pucr2 p2pucr1 p2pucr0 (0xffff_c094) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled note: in dsu (ejtag) mode, port 2 pins function as dsu control pins and the p2d, p2cr, p2ier, p2ddsr and p2pucr are invalid.
tmp19a71 tmp19a71 8-7 8.4 port 3 (p30 to p34) five port 3 pins can be individually programme d to function as discrete general-purpose i/o pins. figure 8.4.1 shows the configuration of port 3 when not used in dsu (ejtag) mode. internal data bus p3cr p3d p3ier selector p3dssr reset low/ high p3pucr s a b p30 p34 p3d read vcc3 note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.4.1 port 3 (p30 to p34
tmp19a71 tmp19a71 8-8 port 3 register 7 6 5 4 3 2 1 0 p3d bit symbol D D D p3d4 p3d3 p3d2 p3d1 p3d0 (0xffff_c0c0) read/write r/w reset value 0 0 0 0 0 0 0 0 function port 3 output data (output latch) note: when p3ier=0, the port state can be read from this register. port 3 control register 7 6 5 4 3 2 1 0 p3cr bit symbol D D D p3cr4 p3cr3 p3cr2 p3cr1 p3cr0 (0xffff_c0c4) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: output disabled 1: output enabled port 3 input enable register 7 6 5 4 3 2 1 0 p3ier bit symbol D D D p3ier4 p3ier3 p3ier2 p3ier1 p3ier0 (0xffff_c0c8) read/write r/w reset value 0 0 0 1 1 1 1 1 function 0: input enabled 1: input disabled port 3 drive strength register 7 6 5 4 3 2 1 0 p3dssr bit symbol D D D p3dssr4 p3dssr3 p3dssr2 p3dssr1 p3dssr0 (0xffff_c0cc) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: low drive capability 1: high drive capability note: the current flowing through ports should not exceed the maximum ratings for each port pin and for all the port pins. port 3 pull-up control register 7 6 5 4 3 2 1 0 p3pucr bit symbol D D D p3pucr4 p3pucr3 p3pucr2 p3pucr1 p3pucr0 (0xffff_c0d4) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled note: in level-1 dsu (ejtag) mode, port 3 pins function as dsu control pins and the p3d, p3cr, p3ier, p3dssr and p3pucr are invalid.
tmp19a71 tmp19a71 8-9 8.5 port 5 (p50 to p57) eight port 5 pins are input-only pins that can al so function as the analog input pins of the ad converter (adc). note 1: as port 5 uses avcc0 as its i/o power source, it must be connected with the 3.3 v source even if adc0 is not used. note 2: when port 5 is not used as analog input pins, the ad conversion accuracy of adc0 may deteriorate by a few lsbs. be sure to check that this poses no problem on your system. p5d read internal data bus p5ier reset p5pucr p50 p56 channel selector conversion result resister ad converter vcc3 figure 8.5.1 port 5 (p50 to p56
tmp19a71 tmp19a71 8-10 p5d read internal data bus p5ier reset p5pucr p57 channel selector conversion result resister ad converter p5fr func. in vcc3 figure 8.5.2 port 5 (p57)
tmp19a71 tmp19a71 8-11 port 5 register 7 6 5 4 3 2 1 0 p5d bit symbol p5d7 p5d6 p5d5 p5d4 p5d3 p5d2 p5d1 p5d0 (0xffff_c140) read/write r reset value 0 0 0 0 0 0 0 0 function port 5 input data note: when p5ier=0, the port state can be read from this register. port 5 input enable register 7 6 5 4 3 2 1 0 p5ier bit symbol p5ier7 p5ier6 p5ier5 p5ier4 p5ier3 p5ier2 p5ier1 p5ier0 (0xffff_c148) read/write r/w reset value 1 1 1 1 1 1 1 1 function 0: input enabled 1: input disabled port 5 pull-up control register 7 6 5 4 3 2 1 0 p5pucr bit symbol p5pucr7 p5pucr6 p5pucr5 p5pucr4 p5pucr3 p5pucr2 p5pucr1 p5pucr0 (0xffff_c154) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled port 5 function register 7 6 5 4 3 2 1 0 p5fr bit symbol p5fr7 D D D D D D D (0xffff_c158) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: port/ad input 1:adtrg0
tmp19a71 tmp19a71 8-12 8.6 port 6 (p60 to p67) the lower 4 bits are input-only pins, and the up per 4 bits can be individually programmed to function as discrete general-purpose i/o pins shared with the analog input pins of the ad converter (adc). note 1: as port 6 uses avcc1 as its i/o power source, it must be connected to the 3.3 v source even if adc1 is not used. note 2: when port 6 is not used as analog input pins, the ad conversion accuracy of adc1 may deteriorate by a few lsbs. when port 6 is used as an output port, this may result in a noticeable deterioration in ad conversion accuracy which may exceed the worst conditions presented in the ad conversion characteristics later in this manual. be sure to check that this poses no problem on your system. p6d read internal data bus p6ier reset p6pucr p60 p63 channel selector conversion result resister ad converter vcc3 figure 8.6.1 port 6 (p60 to p63)
tmp19a71 tmp19a71 8-13 note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.6.2 port 6 (p64 to p67)
tmp19a71 tmp19a71 8-14 port 6 register 7 6 5 4 3 2 1 0 p6d bit symbol p6d7 p6d6 p6d5 p6d4 p6d3 p6d2 p6d1 p6d0 (0xffff_c180) read/write r/w r reset value 0 0 0 0 0 0 0 0 function port 6 output data (output latch) port 6 input data note: when p6ier=0, the port state can be read from this register. port 6 control register 7 6 5 4 3 2 1 0 p6cr bit symbol p6cr7 p6cr6 p6cr5 p6cr4 D D D D (0xffff_c184) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: output disabled 1: output enabled port 6 input enable register 7 6 5 4 3 2 1 0 p6ier bit symbol p6ier7 p6ier6 p6ier5 p6ier4 p6ier3 p6ier2 p6ier1 p6ier0 (0xffff_c188) read/write r/w reset value 1 1 1 1 1 1 1 1 function 0: input enabled 1: input disabled port 6 drive strength register 7 6 5 4 3 2 1 0 p6dssr bit symbol p6dssr7 p6dssr6 p6dssr5 p6dssr4 D D D D (0xffff_c18c) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: low drive capability 1: high drive capability note: the current flowing through ports should not exceed the maximum ratings for each port pin and for all the port pins. port 6 pull-up control register 7 6 5 4 3 2 1 0 p6pucr bit symbol p6pucr7 p6pucr6 p6pucr5 p6pucr4 p6pucr3 p6pucr2 p6pucr1 p6pucr0 (0xffff_c194) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled
tmp19a71 tmp19a71 8-15 port 6 function register 7 6 5 4 3 2 1 0 p6fr bit symbol p6fr7 p6fr6 p6fr5 p6fr4 D D D D (0xffff_c198) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0:port/ad input 1:adtrg1 /int6 0:port/ad input 1:int5 0:port/ad input 1:int4 0:port/ad input 1:int3 note: when the p6fr is set to 1 (port or ad input) with p6cr=1 (output enabled), the output values of this register become undefined.
tmp19a71 tmp19a71 8-16 8.7 port 7 (p70 to p72) three port 7 pins can be individually programmed to function as discrete general-purpose i/o pins shared with the analog input pins of the ad converter (adc). note 1: as port 7 uses avcc1 as its i/o power source, it must be connected to the 3.3 v source even if adc1 is not used. note 2: when port 7 is not used as analog input pins, the ad conversion accuracy of adc1 may deteriorate by a few lsbs. when port 7 is used as an output port, this may result in a noticeable deterioration in ad conversion accuracy which may exceed the worst conditions presented in the ad conversion characteristics later in this manual. be sure to check that this poses no problem on your system. note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.7.1 port 7 (p70 to p72)
tmp19a71 tmp19a71 8-17 port 7 register 7 6 5 4 3 2 1 0 p7d bit symbol D D D D D p7d2 p7d1 p7d0 (0xffff_c1c0) read/write r/w reset value 0 0 0 0 0 0 0 0 function port 7 output data (output latch) note: when p7ier=0, the port state can be read from this register. port 7 control register 7 6 5 4 3 2 1 0 p7cr bit symbol D D D D D p7cr2 p7cr1 p7cr0 (0xffff_c1c4) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: output disabled 1: output enabled port 7 input enable register 7 6 5 4 3 2 1 0 p7ier bit symbol D D D D D p7ier2 p7ier1 p7ier0 (0xffff_c1c8) read/write r/w reset value 0 0 0 0 0 1 1 1 function 0: input enabled 1: input disabled port 7 drive strength register 7 6 5 4 3 2 1 0 p7dssr bit symbol D D D D D p7dssr2 p7dssr1 p7dssr0 (0xffff_c1cc) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: low drive capability 1: high drive capability note: the current flowing through ports should not exceed the maximum ratings for each port pin and for all the port pins. port 7 pull-up control register 7 6 5 4 3 2 1 0 p7pucr bit symbol D D D D D p7pucr2 p7pucr1 p7pucr0 (0xffff_c1d4) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled
tmp19a71 tmp19a71 8-18 port 7 function register 7 6 5 4 3 2 1 0 p7fr1 bit symbol D D D D D p7fr12 p7fr11 p7fr10 (0xffff_c1d8) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0:port/ad input 1:int9 0:port/ad input 1:int8 0:port/ad input 1:int7 note: when the p7fr is set to 1 (port or ad input) with p7cr=1 (output enabled), the output values of this register become undefined. port 7 function register 7 6 5 4 3 2 1 0 p7fr2 bit symbol D D D D D p7fr22 p7fr21 p7fr20 (0xffff_c1dc) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0:port/ad input 1:tb3in 0:port/ad input 1:tb2in 0:port/ad input 1:tb1in
tmp19a71 tmp19a71 8-19 8.8 port 8 (p80 to p87) eight port 8 pins can be individually programme d to function as discre te general-purpose i/o pins. note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.8.1 port 8 (p80 to p87) p8d read internal data bus p8cr p8d p8fr p8ier func. out selector selector p8dssr func. in reset low/ high p8pucr a b s s a b p80 p87 configurable as an open-drain output (bit0,2,6,7) vcc3
tmp19a71 tmp19a71 8-20 port 8 register 7 6 5 4 3 2 1 0 p8d bit symbol p8d7 p8d6 p8d5 p8d4 p8d3 p8d2 p8d1 p8d0 (0xffff_c200) read/write r/w reset value 0 0 0 0 0 0 0 0 function port 8 output data (output latch) note: when p8ier=0, the port state can be read from this register. port 8 control register 7 6 5 4 3 2 1 0 p8cr bit symbol p8cr7 p8cr6 p8cr5 p8cr4 p8cr3 p8cr2 p8cr1 p8cr0 (0xffff_c204) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: output disabled 1: output enabled port 8 input enable register 7 6 5 4 3 2 1 0 p8ier bit symbol p8ier7 p8ier6 p8ier5 p8ier4 p8ier3 p8ier2 p8ier1 p8ier0 (0xffff_c208) read/write r/w reset value 1 1 1 1 1 1 1 1 function 0: input enabled 1: input disabled port 8 drive strength register 7 6 5 4 3 2 1 0 p8dssr bit symbol p8dssr7 p8dssr6 p8d ssr5 p8dssr4 p8dssr3 p8dssr2 p8dssr1 p8dssr0 (0xffff_c20c) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: low drive capability 1: high drive capability note: the current flowing through ports should not exceed the maximum ratings for each port pin and for all the port pins. port 8 open-drain control register 7 6 5 4 3 2 1 0 p8odcr bit symbol p8odcr7 p8odcr6 D D D p8odcr2 D p8odcr0 (0xffff_c210) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: open-drain disabled 1: open-drain enabled port 8 pull-up control register 7 6 5 4 3 2 1 0 p8pucr bit symbol p8pucr7 p8pucr6 p8pucr5 p8pucr4 p8pucr3 p8pucr2 p8pucr1 p8pucr0 (0xffff_c214) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled note: in level-1 dsu (ejtag) mode, p86 and p87 function as dsu control pins and the p8d, p8cr, p8ier, p8dssr, p8odcr and p8pucr are invalid.
tmp19a71 tmp19a71 8-21 port 8 function register 1 7 6 5 4 3 2 1 0 p8fr bit symbol p8fr17 p8fr16 p8fr15 p8fr14 p8fr13 p8fr12 p8fr11 p8fr10 (0xffff_c218) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0:port 1:sclk2 /cts2 0:port 1:tx2 0:port 1:rx2 0:port 1:tb1out /int0 0:port 1:rx1 0:port 1:tx1 0:port 1:rx0 0:port 1:tx0 note: when the p8fr is set to 1 (port input) with p8cr=1 (output enabled), the output values of p81, p83, p84, p85 and p87 become undefined.
tmp19a71 tmp19a71 8-22 8.9 port 9 (p90 to p95) six port 9 pins can be individually programmed to function as discre te general-purpose i/o pins. p93 is shared with the emergency stop sign al input pin (emg pin) of tmrb0, and set as a general-purpose port after reset. p93 can be used as the emg pin by setting the p9fr2.p9fr23 bit which is protected with the lock function. likewise, p95 is shared with the nmi pin, and set as a general-purpose port afte r reset. p95 can be used as the nmi pin by setting the p9fr1.p9fr15 bit which is protected with the lock function. p9d read internal data bus p9cr p9d p9fr p9ier func. out selector p9dssr func. in reset low/ high p9pucr a b s p90p92, p94,p95 vcc3 selector s b a note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.9.1 port 9 (p90 to p92, p94, p95)
tmp19a71 tmp19a71 8-23 p9d read internal data bus pacr p9d p9fr (with lock function) p9ier selector p9dssr func. in reset low/ high p9pucr s a b p93 emg in emg detecton circuit vcc3 note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.9.2 port 9 (p93)
tmp19a71 tmp19a71 8-24 port 9 register 7 6 5 4 3 2 1 0 p9d bit symbol D D p9d5 p9d4 p9d3 p9d2 p9d1 p9d0 (0xffff_c240) read/write r/w reset value 0 0 0 0 0 0 0 0 function port 9 output data (output latch) note: when p9ier=0, the port state can be read from this register. port 9 control register 7 6 5 4 3 2 1 0 p9cr bit symbol D D p9cr5 p9cr4 p9cr3 p9cr2 p9cr1 p9cr0 (0xffff_c244) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: output disabled 1: output enabled port 9 input enable register 7 6 5 4 3 2 1 0 p9ier bit symbol D D p9ier5 p9ier4 p9ier3 p9ier2 p9ier1 p9ier0 (0xffff_c248) read/write r/w reset value 0 0 1 1 1 1 1 1 function 0: input enabled 1: input disabled port 9 drive strength register 7 6 5 4 3 2 1 0 p9dssr bit symbol D D p9dssr5 p9dssr4 p9dssr3 p9dssr2 p9dssr1 p9dssr0 (0xffff_c24c) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0:low drive capability 1: high drive capability note: the current flowing through ports should not exceed the maximum ratings for each port pin and for all the port pins. port 9 pull-up control register 7 6 5 4 3 2 1 0 p9pucr bit symbol D D p9pucr5 p9pucr4 p9pucr3 p9pucr2 p9pucr1 p9pucr0 (0xffff_c254) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled note: p94 is designated as the boot pin. to start up the device in boot mode (see the chapter on flash memory), p94 should be set to 0 during a reset sequence. to start up the device in normal mode, p94 should be set to 1 during a reset sequence.
tmp19a71 tmp19a71 8-25 port 9 function register 1 7 6 5 4 3 2 1 0 p9fr1 bit symbol D D p9fr15 p9fr14 p9fr13 p9fr12 p9fr11 p9fr10 (0xffff_c258) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0:port 1:nmi (with lock function) 0:port 1:tb0out 0:port 1:tb0in 0:port 1:encz 0:pprt 1:encb 0:port 1:enca port 9 function register 2 7 6 5 4 3 2 1 0 p9fr2 bit symbol D D D D p9fr23 p9fr22 p9fr21 p9fr20 (0xffff_c25c) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0:port 1:emg input (with lock function) 0:port 1:sclk3 /cts3 0:port 1:tx3 0:port 1:rx3 port 9 emg control register 7 6 5 4 3 2 1 0 p9ecr bit symbol D D erm emgf emge D D (0xffff_c260) read/write r/w r r/w reset value 0 0 0 0 0 0 0 0 function emg sensitivity 00: low level 01: high level 10: falling edge 11: rising edge (with lock function) emg condition flag 0: normal condition 1: emg condition emg condition clear 1: clear emg condition t his bit is read as 0. (with lock function) p9fr23 is a register bit with the lock function. writing a value to this register requires writing 0x55 and then 0xaa to the p9eclr register. once these values are written, the p9eclr remains in effect until a write to a port 9 register with the lock function is completed. setting the p9fr23 bit to 1 prohibits writes to other registers related to p93. p9fr15 is a register bit with the lock function. writing a value to this bit requires writing 0x55 and then 0xaa to the p9eclr register. once these values are written, the p9eclr remains in effect until a write to a port 9 register with the lock function is completed.
tmp19a71 tmp19a71 8-26 port 9 emg clear register 7 6 5 4 3 2 1 0 p9eclr bit symbol D (0xffff_c264) read/write w reset value D function writing 0x55 and then 0xaa to th is register allows a single write to a register with the lock function. note 1: setting both p9fr13 and p9fr23 to 1 results in undefined behavior. note 2: when the p9fr is set to 1 (port input) with p9cr=1 (output enabled), the output values of p90, p91, p92, p93 and p95 become undefined. 8.9.1 notes on using the emergency stop signal input pin (p93) 8.9.1.1 port operation in the emg condition when p93 set as the emg pin is asserted, output is disabled on p94 and an inttbe0 interrupt is generated in port 9, as shown in table 8.9.1. as the emg detection circuit operates ind ependently of the 16-bit timer, the 16-bit timer continues to operate normally even in case of emergency. table 8.9.1 port operation in the emg condition p93 p94 inttbe0 normal pwm/port output not generated emg hi-z generated
tmp19a71 tmp19a71 8-27 8.9.1.2 register settings for p93 when p93 is set as the emg pin (p9fr2.p9fr2 3=1), other registers related to p93 (i.e., p9cr3, p9ier3, p9dssr3, p9pucr 3, p9fr13) cannot be changed. clearing the p9fr23 bit to 0 enables writes to these registers again. table 8.9.2 shows the register settings for p93 acc ording to the selected function. table 8.9.2 register settings for p93 general-purpose i/o port tb0in emg pin p9cr.p9cr3 x 0 0 (note) p9ier.p9ier3 x 0 0 (note) p9dssr.p9dssr3 x x x (note) p9pucr.p9pucr3 x x 0 (note) p9fr1.p9fr13 0 1 0 p9fr2.p9fr23 0 0 1 note: must be set before the p9fr2.p9fr23 bit is set. general procedure for setting p93 as the emg pin (falling edge sensitive) p9eclr=0x55 0xaa ; release lock p9ecr=10 ; falling edge sensitive p9cr=0 ; disable output p9ier=0 ; enable input p9pucr=0 ; disable pull-up p9eclr=0x55 0xaa ; release lock p9ecr=1 ; clear emg condition p9eclr=0x55 0xaa ; release lock p9fr2=1 ; set p93 as emg pin imr33=10 iclr=0x084 ; clear inttbe0 imr33= 111 ; set inttbe0 interrupt level to 7 (or any level) general procedure for clearing th e emg condition (edge sensitive) (* when the emg pin is set as edge sensitive, make sure that p93 is inactive befor e clearing the emg condition.) p9eclr=0x55 0xaa ; release lock p9ecr=1 ; clear emg condition procedure for returning p93 to a general-purpose port imr33= 000 ; disable inttbe0 interrupt iclr=0x084 ; clear inttbe0 p9eclr=0x55 0xaa ; release lock p9fr23=0 ; set p93 as a general-purpose port 8.9.1.3 sensitivity-rela ted considerations (1) level sensitive when the emg pin is set as level sensitive, the emg condition is held (p9ecr.emgf=1) only while the emg pin is active. therefore, there is no need to clear the emg condition by setting the p9ecr.emge bit to 1. (2) edge sensitive when the emg pin is set as edge sensitive, be sure to check that the emg pin is inactive before making an emg condition setting.
tmp19a71 tmp19a71 8-28 8.10 port a (pa0 to pa7) eight port a pins can be individually programme d to function as discre te general-purpose i/o pins. pa6 is shared with the emergency stop sign al input pin (emg0 pin) of pmd0, and set as a general-purpose port after reset. pa6 can be used as the emg0 pin by setting the pafr.pafr6 bit which is protected with the lock function. note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.10.1 port a (pa0 to pa5, pa7) pad read internal data bus pacr pad pafr paier func. out selector padssr func. in reset low/ high papucr a b s pa0 to pa5, pa7 vcc3 selector s b a
tmp19a71 tmp19a71 8-29 pad read internal data bus pacr pad pafr (with lock function) paier selector padssr emg in reset low/ high papucr s a b pa6 emg detection circuit vcc3 note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.10.2 port a (pa6)
tmp19a71 tmp19a71 8-30 port a register 7 6 5 4 3 2 1 0 pad bit symbol pad7 pad6 pad5 pad4 pad3 pad2 pad1 pad0 (0xffff_c280) read/write r/w reset value 0 0 0 0 0 0 0 0 function port a output data (output latch) note: when paier=0, the port state can be read from this register. port a control register 7 6 5 4 3 2 1 0 pacr bit symbol pacr7 pacr6 pacr5 pacr4 pacr3 pacr2 pacr1 pacr0 (0xffff_c284) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: output disabled 1: output enabled port a input enable register 7 6 5 4 3 2 1 0 paier bit symbol paier7 paier6 paier 5 paier4 paier3 paier2 paier1 paier0 (0xffff_c288) read/write r/w reset value 1 1 1 1 1 1 1 1 function 0: input enabled 1: input disabled port a drive strength register 7 6 5 4 3 2 1 0 padssr bit symbol padssr7 padssr6 padssr 5 padssr4 padssr3 padssr2 padssr1 padssr0 (0xffff_c28c) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: low drive capability 1: high drive capability note: the current flowing through ports should not exceed the maximum ratings for each port pin and for all the port pins. port a pull-up control register 7 6 5 4 3 2 1 0 papucr bit symbol papucr7 papucr6 papucr5 papucr4 papucr3 papucr2 papucr1 papucr0 (0xffff_c294) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled
tmp19a71 tmp19a71 8-31 port a function register 7 6 5 4 3 2 1 0 pafr bit symbol pafr7 pafr6 pafr5 pafr4 pafr3 pafr2 pafr1 pafr0 (0xffff_c298) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0:port 1:tb2out/ int1 0:port 1:emg0 (with lock function) 0:port 1:z0 0:port 1:w0 0:port 1:y0 0:port 1:v0 0:port 1:x0 0:port 1:u0 port a emg control register 7 6 5 4 3 2 1 0 paecr bit symbol D D erma emgfa emgea D D (0xffff_c29c) read/write r/w r r/w reset value 0 0 0 0 0 0 0 0 function emg sensitivity 00: low level 01: high level 10: falling edge 11: rising edge (with lock function) emg condition flag 0: normal condition 1: emg condition emg condition clear 1: clear emg condition this bit is read as 0. (with lock function) port a emg clear register 7 6 5 4 3 2 1 0 paeclr bit symbol D (0xffff_c2a0) read/write w reset value D function writing 0x55 and then 0xaa to this register allows a single write to a port a register with the lock function. note: when the pafr is set to 1 (port input) with pacr=1 (output enabled), the output values of pa6 and pa7 become undefined. for details, see 8.12 notes on using the emergency stop signal input pins (pa6, pb6). when the pafr6 bit is set to 1, pa6 is used as the emg0 pin. the pafr6 bit has the lock function, and writing a value to this bit requires writing 0x55 and then 0xaa to the paeclr register. once these values are written, the paeclr register remains in effect until a write to a port a register with the lock function is completed. setting the pafr6 bit to 1 prohibits writes to other registers related to pa6.
tmp19a71 tmp19a71 8-32 8.11 port b (pb0 to pb7) eight port b pins can be individually programme d to function as discre te general-purpose i/o pins. pb6 is shared with the emergency stop sign al input pin (emg1 pin) of pmd1, and set as a general-purpose port after reset. pb6 can be used as the emg1 pin by setting the pbfr.pbfr6 bit which is protected with the lock function. note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.11.1 port b (pb0 to pb5, pb7) pbd read internal data bus pbcr pbd pbfr pbier func. out selector pbdssr func. in reset low/ high pbpucr a b s pb0 to pb5, pb7 vcc3 selector s b a
tmp19a71 tmp19a71 8-33 pbd read internal data bus pbcr pbd pbfr (with lock function) pbier selector pbdssr emg in reset low/ high pbpucr s a b pb6 emg detection circuit vcc3 note: the selectors in the figure output input a when s=1 and input b when s=0. figure 8.11.2 port b (p86)
tmp19a71 tmp19a71 8-34 port b register 7 6 5 4 3 2 1 0 pbd bit symbol pbd7 pbd6 pbd5 pbd4 pbd3 pbd2 pbd1 pbd0 (0xffff_c2c0) read/write r/w reset value 0 0 0 0 0 0 0 0 function port b output data (output latch) note: when pbier=0, the port state can be read from this register. port b control register 7 6 5 4 3 2 1 0 pbcr bit symbol pbcr7 pbcr6 pbcr5 pbcr4 pbcr3 pbcr2 pbcr1 pbcr0 (0xffff_c2c4) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: output disabled 1: output enabled port b input enable register 7 6 5 4 3 2 1 0 pbier bit symbol pbier7 pbier6 pbier 5 pbier4 pbier3 pbier2 pbier1 pbier0 (0xffff_c2c8) read/write r/w reset value 1 1 1 1 1 1 1 1 function 0: input enabled 1: input disabled port b drive strength register 7 6 5 4 3 2 1 0 pbdssr bit symbol pbdssr7 pbdssr6 pbdssr 5 pbdssr4 pbdssr3 pbdssr2 pbdssr1 pbdssr0 (0xffff_c2cc) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: low drive capability 1: high drive capability note: the current flowing through ports should not exceed the maximum ratings for each port pin and for all the port pins. port b pull-up control register 7 6 5 4 3 2 1 0 pbpucr bit symbol pbpucr7 pbpucr6 pbpucr5 pbpucr4 pbpucr3 pbpucr2 pbpucr1 pbpucr0 (0xffff_c2d4) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0: pull-up disabled 1: pull-up enabled
tmp19a71 tmp19a71 8-35 port b function register 7 6 5 4 3 2 1 0 pbfr bit symbol pbfr7 pbfr6 pbfr5 pbfr4 pbfr3 pbfr2 pbfr1 pbfr0 (0xffff_c2d8) read/write r/w reset value 0 0 0 0 0 0 0 0 function 0:port 1:tb3out/ int2 0:port 1:emg1 (with lock function) 0:port 1:z1 0:port 1:w1 0:port 1:y1 0:port 1:v1 0:port 1:x1 0:port 1:u1 port b emg control register 7 6 5 4 3 2 1 0 pbecr bit symbol D D ermb emgfb emgeb D D (0xffff_c2dc) read/write r/w r r/w reset value 0 0 0 0 0 0 0 0 function emg sensitivity 00: low level 01: high level 10: falling edge 11: rising edge (with lock function) emg condition flag 0: normal condition 1: emg condition emg condition clear 1: clear emg condition this bit is read as 0. (with lock function) port b emg clear register 7 6 5 4 3 2 1 0 pbeclr bit symbol D (0xffff_c2e0) read/write w reset value D function writing 0x55 and then 0xaa to this register allows a single write to a port b register with the lock function. note: when the pbfr is set to 1 (port input) with pbcr=1 (output enabled), the output values of pb6 and pb7 become undefined. for details, see 8.12 notes on using the emergency stop signal input pins (pa6, pb6). when the pbfr6 bit is set to 1, pb6 is used as the emg1 pin. the pbfr6 bit has the lock function, and writing to this bit requires writing 0x55 and then 0xaa to the pbeclr register. once these values are written, the pbeclr register remains in effect until a write to a port b register with the lock function is completed. setting the pbfr6 bit to 1 prohibits writes to other registers related to pb6.
tmp19a71 tmp19a71 8-36 8.12 notes on using the emergency st op signal input pins (pa6, pb6) 8.12.1 block diagram of the emg detection circuit note: the following descriptions for pa[6:0] (pmd0) also apply to pb[6:0] (pmd1), unless otherwise noted. when pa6 is set as the emergency stop signal input pin (emg0 pin), an emg input activates the emg detection circuit of pmd0 and forcefully disables output on pa[5:0] even if these pins are not set for pmd0 output. the emg detection circuit of pmd0 is enabled by setting the emgcr0.emgen bit to 1 in addition to setting pa6 as the emg0 pin. figure 8.12.1 shows a block diagram of the emg detection circuit. emg detection circuit paecr paier6 pafr6 emgcr0 emg detection circuit pacr[5:0] pa[5:0] emg0 pmdtrg0 intemg0 pmd0 port a mdout0 trg generation circuit pwm generation circuit port output disabled pwm inactive pmdtrg disabled figure 8.12.1 block diagram of emg detection circuit 8.12.2 operations in the emg condition when port a and pmd are put in the emg condition, the following operations are performed. ? in port a, output is disabled on pa[5:0]. ? in pmd, pwm output is made inactive, adc start trigger (pmdtrg) is disabled, and an intemg interrupt is generated. table 8.12.1 shows a summary of operations in the emg condition for pmd and port a which op erate independently of each other. table 8.12.1 pmd and port a operations in the emg condition pmd port a pa[5:0] pmdtrg intemg normal normal pwm/port output trigger enabled interrupt not generated emg normal inactive trigger disabled interrupt generated (note 1) normal emg hi-z trigger enabled interrupt not generated emg emg hi-z trigger di sabled interrupt generated note: if pa6 is not set as the emg0 pin, no emg input will be accepted and thus pmd will not be put in the emg condition. the combination of pmd=emg and port a=normal occurs only when the emg condition is cleared in port a when pmd=emg and port a=emg.
tmp19a71 tmp19a71 8-37 8.12.3 register settings for pa6 when pa6 is set as the emg0 pin (pafr.pafr 6=1), other registers related to pa6 (i.e., pacr6, paier6, padssr6, papucr6) cannot be ch anged. clearing the pafr6 bit to 0 enables writes to these registers again. table 8.12.2 shows the register settings for pa6 according to the select ed function. table 8.12.2 register settings for pa6 general-purpose i/o port emg pin pacr.pacr6 x 0 (note ) paier.paier6 x 0 (note) padssr.padssr6 x x (note) papucr.papucr6 x 0 (note) pafr.pafr6 0 1 note: must be set before the pafr.pafr6 bit is set. general procedure for setting pa6 as the emg0 pin (falling edge sensitive) paeclr=0x55 0xaa ; release lock paecr=10 ; falling edge sensitive pacr=0 ; disable output paier=0 ; enable input papucr=0 ; disable pull-up paeclr=0x55 0xaa ; release lock paecr=1 ; clear emg condition (must be set separately from setting edge sensitivity) paeclr=0x55 0xaa ; release lock pafr=1 ; set pa6 as emg0 imr22=10 iclr=0x058 ; clear intemg0 imr22=111 ; set intemg0 interrupt level to 7 (or any level) general procedure for clearing th e emg condition (edge sensitive) paeclr=0x55 0xaa ; release lock paecr=1 ; clear emg condition in port a mdout0=000000 ; make pwm output inactive (through pmd register) emgcr0=1 ; clear emg condition in pmd (through pmd register) mdout0=xxxxxx ; set pwm out put as desired (through pmd register) note 1: when emg0 is set as edge sensitive, be sure to check that emg0 is inactive before cleari ng the emg condition. note 2: if the emg condition is cleared only in pmd and not in po rt a, pmd is put in the emg condition again and an intemg0 int errupt is generated. general procedure for clearing the emg condition (lev el sensitive) mdout0=000000 ; make pwm output inactive (through pmd register) emgcr0=1 ; clear emg condition in pmd (through pmd register) mdout0=xxxxxx ; set pwm out put as desired (through pmd register) note 1: when emg0 is set as level sensitive, port a is put in the emg condition only while emg0 is active. thus, the emg condit ion should be cleared only in pmd. note 2: if the emg condition is cleared only in pmd and not in po rt a, pmd is put in the emg condition again and an intemg0 int errupt is generated. procedure for returning pa6 to a general-purpose port imr22= 000 ; disable intemg0 interrupt iclr=0x058 ; clear intemg0 paeclr=0x55 0xaa ; release lock pafr=0 ; set pa6 as a general-purpose port
tmp19a71 tmp19a71 8-38 when emg0 is set as level sensitive, port a is put in the emg condition only while emg0 is active (paecr.emgfa=1). thus, there is no need to clear the emg condition in port a by setting paecr.emgea to 1. howe ver, when the emg detection circuit is enabled in pmd, the emg condition must be cleared in pmd by setting emgcr1.emgrs to 1 after making sure that emg0 is inactive. when emg0 is set as edge sensitive, make sure that emg0 is inactive before making an emg condition setting. 8.12.4 difference between p93 (tb0in) and pa6 (emg0)/pb6 (emg1) p93 can also be used as the emg pin. the main difference between p93 and pa6/pb6 is that port 9 generates an emg interrupt as shown in figure 8.12.2. in the case of pa6/pb6, when the em g function is disabled in pmd (emgcr.emgen=0), no emg interrupt (intemgx) is generated whereas p93 causes an emg interrupt (i nttbe0) to be generated as soon as port 9 is put in the emg condition. emg detection circuit p9ecr p9ier3 p9fr23 p9cr4 p9d4 emg input inttbe0 port 9 port output disabled figure 8.12.2 p93 (emg pin) block diagram
tmp19a71 tmp19a 71 9-1 9. debug support unit (dsu ) tmp 19a71 is supplied with dsu ( debug supp ort unit ) mode. this function makes a subset of ports be dsu control pins. the dsu mode has two types; lv.1 (12- pin mode) and lv.0 (5 -pin mode). using 12 control pins, lv.1 provides more pow erful debug function than lv.0 does. the mode can be used like selsecting lv.1 in the first stage of debug operation where it needs larger debug information, and lv.0 in the last stage of debug operation since lv.0 has less pin restriction. 9.1 dsu (ejtag) mode setting to set the dsu mode, l must be set to eje of an external pin that is in reset cycle, and then tmp 19a71 becomes in dsu (ejtag) mode when it is started up with the dsu level, dsu -probe first. if dsu -probe is not connected, it starts from lv.0. note 1: dsu disabled must be released for the mask version. 9.1.1 pin status upon the dsu (ejtag) mode startup when tmp 19a71 starts in dsu (ejtag) mode, a specific pin register automatically changes into dsu control pin regardless of its setting. in addition, as a read value of register, a set value can be read. 9.1.2 motor breakage prevention tmp 19a71 has a mechanism that automatically turns its moter output off (rxcrn=0) to prevent the motor breakage upon the break execution (including onestep execution) in the dsu mode. intended ports are p94(tb0out), pa[5:0](pmd0), and pb[5:0](pmd1). their pxcrn becomes 0 (output of a prescribed bit n of portx disabled) only when they are set to the motor control outputs ( tb0out, pmd0, and pmd1 ). to resume the motor control, 1 is to be set to pxcrn. the motor control output, however, does not restart when it is started after changing the port setting in ide. the port must be set during the programming.
tmp19a71 tmp19a71 9-2 9.2 pin status in reset cycle 9.2.1 pins whose status change according to mode; normal and dsu table 9.2 . 1 shows the status change upon resetting of each pin. even when a pin is not connected to dsu -probe in dsu mode, its status becomes the same as in dsu mode shown in table 9.2 .1. table 9.2 .1 pin status in reset cycle pin normal mode (eje=?h?) dsu mode (eje=?l?) p20(tck) hi-z hi-z(tck) p21(tms) hi-z hi-z(tms) p22(tdi) hi-z hi-z(tdi) p23(tdo) ( ?? 2) hi-z undefined (t do) p24(dint) hi-z hi-z(dint) p30(tpc) hi-z hi-z p31(pcst0) hi-z hi-z p32(pcst1) hi-z hi-z p33(pcst2) hi-z hi-z p34(dclk) hi-z hi-z p86(tx2/pcst3) hi-z hi-z p87(sclk2/cts2/pcst4) hi-z hi-z p94(tb0out/boot) external ?h ? fixed *note 1 external ?h ? fixed *note 1 other general -purposed i/o port hi-z hi-z eje external ?h ? fixed external ?l? fixed reset external ?l? fixed external ?l? fixed test0 external ?l? fixed external ?l? fixed test1 external ?l? fixed external ?l? fixed note 1: these pins must be fixed externally until the reset is released. note 2: even during the reset, the behavior of p23(tdo) shall be unstable until its internal current becomes stable.
tmp19a71 tmp19a 71 9-3 9.2.2 pin status upon the connection to dsu -probe upon the connection of dsu -probe, an output value of a port changes until the connection is completed. since, as for pins used in lv.1 , there is only changes in output values of a pin to be used but no change in switching timing, here dclk(p34) is described. 9.2.2.1 dsu -probe connection (lv.1) debug start reset button is pressed with a debugger. vcc reset proben( ??1 ) dclk(p34) ?? 10 ms ( t . b.d ) hi-z reset by dsu-probe note1: internal signal debug lv.0?1 figure 9.2 . 1 shows, in the connection in lv.1 , dsu -probe sets 1 to proben of an internal register after the second reset being performed that follows the power supply. when the second reset is released, a dsu control pin used in lv.1 mode switches to the one for dsu control and starts communication with dsu -probe . note1: for the first reset releasing cycle, refer to the operation manual of dsu -probe you are using. debug start reset button is pressed with a debugger. vcc reset proben (?? 1 ) dclk(p34) ?? 10 ms(t .b.d) hi-z reset by dsu-probe note1: internal signal debug lv.0?1 figure 9.2 .1 dsu -probe connection (lv.1) 9.2.2.2 dsu -probe connection (lv.0) as figure 9.2 .2 dsu -probe connection (lv.0) upon the connection in lv. 0 mode, dsu -probe sets 1 to proben of an internal register after the second reset being performed that follows the power supply. by setting 0 to eje, dsu control pin to be used in lv.0 mode behaves as the one for dsu control immediately after t he power supply. note1: for the first reset releasing cycle, refer to the operation manual of dsu -probe you are using.
tmp19a71 tmp19a71 9-4 debug start reset button is pressed by a debugger. vcc reset proben (?? 1 ) dclk(p34) ?? 10 ms(t .b.d) hi-z reset by dsu-probe note 1: internal signal figure 9.2 .2 dsu -probe connection (lv.0)
tmp19a71 tmp19a 71 9-5 9.2.3 dsu -probe disabled this functions when debugging by using dsu -probe. it is an i/f exclusive for connecting to dsu -probe. for details of debug utilizing dsu -probe, refer to the operation manual of dsu -p robe you are using. here, dsu -probe enabled/disabled in dsu (ejtag) mode is described. 1. dsu -probe enabled/disabled this device can debug by using dsu -probe on borad. therefore, it has the function that disables use of dsu -probe (hereinafter referred to as dsu disabled), which allows no third party to read data of incorporated flash easily. validating the dsu disabled makes it impossible to use dsu -probe. 2. dsu disabled (disabling debug that uses dsu -probe) user can validate the writer security functin o f flash itself by issuing the protect commands described later to all the two blocks of the flash upon the program debug completion. in this condition, even if a reading is tryed by using a writer, data of incorporated flash cannot be read. debug is impossible by using dsu -brobe after its power is turned off unless dsu disabled is set upon the next powering and dsu disabled is released. 3. dsu enabled (enabling debug that uses dsu -probe) dsu disabled is fail- safe to prevent any accidental release caused wi th such as runaway. to release dsu disabled, 0 must be set to the dsu security mode register, seqmod, and the security code ?0x0000_00c5 ? must be written in the dsu security control register, seqcnt. then the debug using dsu -probe becomes active. t he security function becomes active again by setting 1 to seqmod without turning off the power and writing ?0x0000_00c5 ? in seqcnt. 4. initialization of seqmod flash products are not initialized by the normal reset. they are initialized onl y by supplying power (power - on reset). mask products are not initialized by the reset with wdt. they are initialized by an external reset.
tmp19a71 tmp19a71 9-6 31 30 29 28 27 26 25 24 seqmod bit symbol - - - - - - - - (0xffff_e510) read/write r reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r reset value 0 0 0 0 0 0 0 0 function 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r reset value 0 0 0 0 0 0 0 0 function 7 6 5 4 3 2 1 0 bit symbol - - - - - - - dsuoff read/write r r/w reset value 0 0 0 0 0 0 0 1 function 1: dsu disabled 0: dsu enabled note 1: this register must be accessed by 32-bit system. it is not accessible with any bit operation instruction. 31 30 29 28 27 26 25 24 seqcnt bit symbol - - - - - - - - (0xffff_e514) read/write w reset value - - - - - - - - function must be written as 0x0000_00c5 . 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write w r eset value - - - - - - - - function must be written as 0x0000_00c5 . 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write w reset value - - - - - - - - function must be written as 0x0000_00c5 . 7 6 5 4 3 2 1 0 bit symbol - - - - - - - - read/write w reset value - - - - - - - - function must be written as 0x0000_00c5 . note 1: this register must be accessed by 32-bit system. it is not accessible with any bit operation instruction.
tmp19a71 tmp19a 71 9-7 5. example of use by user example of how to use dsu -probe using this function is shown below. figure 9.2 .3 example use of dsu disabled [dsu - probe enabled] dsu is enabled until power off (flash product)/external reset (mask product ?j tmp19a71 dsu disabled by power -on ?i disabled by reset for maskrom products ?j determination program of dsu enabled (user made) is dsu disabled released? release of dsu disabled as writing in seqmod and seqcnt is executed. [dsu - pr obe disabled] remained dsu disabled n external port data
tmp19a71 10. dma controller (dmac) the tmp19a71 contains an eight-channel dma controller (dmac). 10.1 features the dmac has the following features: (1) ei ght independent dma channels (2) t ransfer requests: internal transfer requests: software initiated external transfer requests: interrupt signals from on-chip i/o peripherals and external interrupt pins (3) dual-address mode (4) memory-to-memory, memory-to-i/o, and i/o-to-memory transfers (5) transfer width: ? me mory: 32-bit ? i/ o peripherals: 8-, 16-, and 32-bit (6) address pointers can increment, decrement or remain constant. the user can program the bit positions at which address in crement or decrement occurs. (7) fi xed channel priority tmp19a71 10-1
tmp19a71 10.2 implementation 10.2.1 on-chip dmac interface figure 10.2.1 shows how the dmac is internally connected with the tx19a core processor and th e interrupt controller (intc). * internal signals figure 10.2.1 dmac connections within the tmp19a71 the dmac provides eight independently programmable channels. with each dma chann el, there are two associat ed signals: a dma request ( intdreqn ) and a dma acknowledge ( dackn ), where n is a channel number from 0 to 7. channel priority is fixed. channel 0 has the highest priority, and channel 7 has the lowest priority. the tx19a core processor has a snoop function. the snoop function releases the tx19a core processor?s data bus to the dmac, enabling the dmac to access the internal rom and internal ram connected with the tx 19a core processor. the dmac can select whether or not to use this snoop function. for details, see ?10.2.3 snoop function?. the dmac can use two types of bus request: sreq and greq. greq is used when the snoop fu nction is not used, and sreq is used when the snoop function is used. sreq has higher priority than greq. note: in debug mode (cp0?s debug.dm=1), peripheral functions cannot be accessed properly with sreq. in debug mode, do not use sreq to access peripheral functions. tx19a core processor address data bus grant control bus request bus release request busgnt busrel * intdreq [7 : 0] * dack [7 : 0] * dmac bus grant acknowledge haveit * interrupt controller (external requests) on-chip i/o peripheral interrupt requests external interrupt requests busreq * * tmp19a71 10-2
tmp19a71 10.2.2 dmac block the dmac block diagram is shown in figure 10.2.2 . channel 3 channel 2 destination address register (darx source address register (sarx byte count register (bcrx channel control register (ccrx 31 0 channel 0 dma control register (dcr data holding register (dhr channel status register (csrx dma transfer control register (dtcrx x 0 to 7 channel 4 channel 5 channel 6 channel 7 channel 1 figure 10.2.2 dmac block diagram 10.2.3 snoop function the tx19a core processor has the snoop function, which releases the tx19a core processor?s data bus to the dmac. when the snoop function is used, the tx19a core processor stops operating until the dmac relinquishes the bus. the snoop function enables the dmac to access the internal ram and internal rom so that these locations can be specified as source and destination addresses. when the snoop function is not used, the dmac cannot access the internal ram and int ernal rom. however, even when the snoop function is not used, the g-bus is released to the dmac. if the tx19a core processor tries to access memory or i/o through the g-bus, pipeline operation will be stalled until the dmac relinquishes bus mastership. note: when the snoop function is not used, the tx19a core processor does not release the data bus to the dmac. in this case, if an internal ram or rom lo cation is specified as a dma source or destination address, no acknowledge signal will be returned for the bus request from the dmac and bus operation will be locked. tmp19a71 10-3
tmp19a71 10.2.4 register description the dmac has fifty 32-bit registers, as listed in table 10.2.1 . table 10.2.1 dmac register map (1/2 ) address symbol register name 0xffff_d600 ccr0 channel control register (channel 0) 0xffff_d604 csr0 channel status register (channel 0) 0xffff_d608 sar0 source addr ess register (channel 0) 0xffff_d60c dar0 destination address register (channel 0) 0xffff_d610 bcr0 byte count register (channel 0) 0xffff_d618 dtcr0 dma transfer control register (channel 0) 0xffff_d620 ccr1 channel control register (channel 1) 0xffff_d624 csr1 channel status register (channel 1) 0xffff_d628 sar1 source addr ess register (channel 1) 0xffff_d62c dar1 destination address register (channel 1) 0xffff_d630 bcr1 byte count register (channel 1) 0xffff_d638 dtcr1 dma transfer control register (channel 1) 0xffff_d640 ccr2 channel control register (channel 2) 0xffff_d644 csr2 channel status register (channel 2) 0xffff_d648 sar2 source addr ess register (channel 2) 0xffff_d64c dar2 destination address register (channel 2) 0xffff_d650 bcr2 byte count register (channel 2) 0xffff_d658 dtcr2 dma transfer control register (channel 2) 0xffff_d660 ccr3 channel control register (channel 3) 0xffff_d664 csr3 channel status register (channel 3) 0xffff_d668 sar3 source addr ess register (channel 3) 0xffff_d66c dar3 destination address register (channel 3) 0xffff_d670 bcr3 byte count register (channel 3) 0xffff_d678 dtcr3 dma transfer control register (channel 3) 0xffff_d680 ccr4 channel control register (channel 4) 0xffff_d684 csr4 channel status register (channel 4) 0xffff_d688 sar4 source addr ess register (channel 4) 0xffff_d68c dar4 destination address register (channel 4) 0xffff_d690 bcr4 byte count register (channel 4) 0xffff_d698 dtcr4 dma transfer control register (channel 4) 0xffff_d6a0 ccr5 channel control register (channel 5) 0xffff_d6a4 csr5 channel status register (channel 5) 0xffff_d6a8 sar5 source addr ess register (channel 5) 0xffff_d6ac dar5 destination addr ess register (channel 5) 0xffff_d6b0 bcr5 byte count register (channel 5) 0xffff_d6b8 dtcr5 dma transfer control register (channel 5) 0xffff_d6c0 ccr6 channel control register (channel 6) 0xffff_d6c4 csr6 channel status register (channel 6) 0xffff_d6c8 sar6 source addr ess register (channel 6) 0xffff_d6cc dar6 destination address register (channel 6) 0xffff_d6d0 bcr6 byte count register (channel 6) 0xffff_d6d8 dtcr6 dma transfer control register (channel 6) tmp19a71 10-4
tmp19a71 table 10.2.2 dmac register map (2/2) address symbol register name 0xffff_d6e0 ccr7 channel control register (channel 7) 0xffff_d6e4 csr7 channel status register (channel 7) 0xffff_d6e8 sar7 source addr ess register (channel 7) 0xffff_d6ec dar7 destination addr ess register (channel 7) 0xffff_d6f0 bcr7 byte count register (channel 7) 0xffff_d6f8 dtcr7 dma transfer control register (channel 7) 0xffff_d700 dcr dma control register (dmac) 0xffff_d704 reserved 0xffff_d70c dhr data holding register (dmac) note: although the dmac registers are 32-bit wide, they can be accessed in 8-bit or 16-bit units. for example, the ccr0[31:0] register can be divided into four 8-bit registers: ccr0[7:0]=ccr0ll, ccr0[15:8]=ccr0lh, ccr0[23:16]=ccr0hl and ccr0[31:24]=ccr0hh. for details, see ?18. i/o register summary?. tmp19a71 10-5
tmp19a71 there are basically no functional differences among the eight dmac channels. in the following register descriptions, only dmac0 is explained. 10.2.5 dma control register (dcr) 7 6 5 4 3 2 1 0 dcr bit s ymbol rst7 rst6 rst5 rst4 rst3 rst2 rst1 rst0 (0xffff_d700) read/write w w w w w w w w reset value 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - read/write r reset value 0x00 23 22 21 20 19 18 17 16 bit symbol - read/write r reset value 0x00 31 30 29 28 27 26 25 24 bit symbol rstall - read/write w r reset value 0 0 0 0 0 0 0 0 bit mnemonic field name description 31 rstall reset all performs a software reset of the dmac. when the rstall bit is set to 1, all the dmac internal registers are initialized to their reset values. any transfer requests are removed and all the eight dma channels are put in idle state. 0: don't care 1: reset the dmac. 7 rst7 reset 7 performs a software reset of dmac channel 7. when the rst7 bit is set to 1, all the dmac cha nnel 7 internal registers are initialized to their reset va lues. any transfer requests for channel 7 are removed and channel 7 is put in idle state. 0: don't care 1: reset dmac channel 7. 6 rst6 reset 6 performs a software reset for dmac channel 6. when the rst6 bit is set to 1, all the dmac channel 6 internal registers are initialized to their reset va lues. any transfer requests for channel 6 are removed and channel 6 is put in idle state. 0: don't care 1: reset dmac channel 6. 5 rst5 reset 5 performs a software reset for dmac channel 5. when the rst5 bit is set to 1, all the dmac channel 5 internal registers are initialized to their reset va lues. any transfer requests for channel 5 are removed and channel 5 is put in idle state. 0: don't care 1: reset dmac channel 5. tmp19a71 10-6
tmp19a71 bit mnemonic field name description 4 rst4 reset 4 performs a software reset of dmac channel 4. when the rst4 bit is set to 1, all the dmac channel 4 internal registers are initialized to their reset values. any transfer requests for channel 4 are removed and channel 4 is put in idle state. 0: don't care 1: reset dmac channel 4. 3 rst3 reset 3 performs a software reset of dmac channel 3. when the rst3 bit is set to 1, all the dmac channel 3 internal registers are initialized to their reset values. any transfer requests for channel 3 are removed and channel 3 is put in idle state. 0: don't care 1: reset dmac channel 3. 2 rst2 reset 2 performs a software reset of dmac channel 2. when the rst2 bit is set to 1, al the dmac channel 2 internal registers are initialized to their reset values. any transfer requests for channel 2 are removed and channel 2 is put in idle state. 0: don't care 1: reset dmac channel 2. 1 rst1 reset 1 performs a software reset of dmac channel 1. when the rst1 bit is set to 1, all the dmac channel 1 internal registers are initialized to their reset values. any transfer requests for channel 1 are removed and channel 1 is put in idle state. 0: don't care 1: reset dmac channel 1. 0 rst0 reset 0 performs a software reset of dmac channel 0. when the rst0 bit is set to 1, all the dmac channel 0 internal registers are initialized to their reset values. any transfer requests for channel 0 are removed and channel 0 is put in idle state. 0: don't care 1: reset dmac channel 0. note 1: if a software reset command is written to the dcr register immediately after the completion of the transfer cycle of a dma transaction, the dma-done interrupt will not be cleared. in this case, the software reset only initializes channel registers and other settings. note 2: do not issue a software reset command to the dcr register via a dma transfer. note 3: this register does not support bit manipulation instructions. tmp19a71 10-7
tmp19a71 10.2.6 channel control register (ccr0) 7 6 5 4 3 2 1 0 ccr0 bit s ymbol sac dio dac trsiz dps (0xffff_d600) read/write r/w r/w r/w r/w r/w reset value 0 0 00 00 00 15 14 13 12 11 10 9 8 bit s ymbol - exr - - - - stio sac read/write r/w r/w r/w r/w r/w reset value 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit s ymbol nien abien - - - - - - read/write r/w r/w r/w r/w r/w r/w reset value 1 1 1 0 0 0 1 0 31 30 29 28 27 26 25 24 bit symbol str - - - - - - - read/write w r w reset value 0 0 0 0 0 0 0 - bit mnemonic field name description 31 str channel start (reset value: ) enables the corresponding dma channel . setting this bit to 1 puts the dma channel in ready state. dm a transfer starts as soon as a transfer request is received. only a write of 1 is valid, and a write of 0 has no effect. this bit is alw ays read as 0. 1: enable the dma channel. 24 ? (reserved) this bit is reserved. it must al ways be written as 0. 23 nie0 normal completion interrup t enable (reset value: 1) 1: enable interrupts on normal conversion completion. 0: disable interrupts on normal conversion completion. 22 abie0 abnormal completion interrupt enable (reset value: 1) 1: enable interrupts on abnormal conversion completion. 0: disable interrupts on abnorma l conversion completion. 21 ? (reserved) this bit is reserved. it is reset to 1, but must always be written as 0. 20 : 18 ? (reserved) this bit is reserved. it must al ways be written as 0. 17 ? (reserved) this bit is reserved. it is reset to 1, but must always be written as 0. 16 : 15 ? (reserved) this bit is reserved. it must al ways be written as 0. 14 exr external request mode (reset value: 0) specifies a transfer request mode. 1: external transfer request (interrupt request) 0: internal transfer request (software start) 13 ? (reserved) this bit is reserved. it must al ways be written as 0. tmp19a71 10-8
tmp19a71 bit mnemonic field name description 12 ? (reserved) this bit is reserved. it is reset to 0, but must always be written as 1. 11 sreq snoop request (reset value: 0) specifies whether or not to use the snoop function. when the snoop is used, the tx 19a core processo r releases the data bus to the dmac. 1: use the snoop function. (sreq) 0: do not use the snoop function. (greq) 10 relen release request enable (reset value: 0) specifies whether or not to respond to a bus release request from the tx19a core processor. this bit is valid only when greq is used. when sreq is used, the tx 19a core processor cannot issue a bus release request. 1: respond to a bus release request from the tx19a core processor w hen the dmac has bus mastership. when the tx19a core processor issues a bus release request, the dmac relinquishes the bus upon comp letion of the current bus operation. 0: do not respond to a bus release request from the tx19a core processor. 9 stio source i/o (reset value: 0) specifies the type of the source device. 1: i/o device 0: memory 8 : 7 sac source address count (reset value: 00) specifies the manner in which the source address changes after each cy cle. 1x: fixed 01: decremented 00: incremented 6 dio destination i/o (reset value: 0) specifies the type of the destination device. 1: i/o device 0: memory 5 : 4 deac destination address count (reset value: 00) specifies the manner in which the destination address changes after each c ycle. 1x: fixed 01: decremented 00: incremented 3 : 2 trsiz transfer size (reset value: 00) specifies the amount of data to be transferred in response to a dma request. 11: 8 bits (1 byte) 10: 16 bits (2 bytes) 0x: 32 bits (4 bytes) 1 : 0 dps device port size (reset value: 00) specifies the bus width of the i/o device specified as a source or destination device. 11: 8 bits (1 byte) 10: 16 bits (2 bytes) 0x: 32 bits (4 bytes) tmp19a71 10-9
tmp19a71 note1: the ccrn register must be programmed before placing the dmac in ready state. note 2: the dps field has no meaning or effect on memory-to-memory transfers. note 3: when ccrn.dio=1 (i/o device), do not specify the internal ram or cg/irc registers as a destination device. note 4: this register does not support bit manipulation instructions. 10.2.7 channel status register (csr0) 7 6 5 4 3 2 1 0 csr0 bit symbol - - - - - - - - (0xffff_d604) read/write r r/w reset value 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r reset value 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol nc abc - bes bed conf - - read/write r/w r reset value 0 0 0 0 0 0 0 0 31 30 29 28 27 26 25 24 bit symbol act - - - - - - - read/write r reset value 0 0 0 0 0 0 0 0 bit mnemonic field name description 31 act channel active (reset value: 0) indicates whether or not the dma channel is in ready state. 1: the dma channel is in ready state. 0: the dma channel is not in ready state. 23 nc normal completion (reset value: 0) if set, the dma channel has terminated by normal completion. if the nie0 bit in the c cr0 register is set, an interrupt is generated. the nc bit is cleared by writing a 0 to it. clearing the nc bit causes the interrupt to be cleared. the nc bit must be cleared to prior to starting the next transfer. an attempt to set th e str bit in the cce0 when nc=1 will cause an error. a write of 1 has no effect on this bit. 1: the dma channel has terminated by normal completion. 0: the dma channel has not terminated by normal completion. tmp19a71 10-10
tmp19a71 bit mnemonic field name description 22 abc abnormal completion (reset value: 0) if set, the dma channel has terminated with an error. if the abie0 bit i n the ccr0 register is set, an interrupt is generated. the abc bit can be cleared by writi ng a 0 to it. clearing the abc bit causes the interrupt to be cleared and the bes, bed and conf bits to be also cleared. the abc bit must be cleared prior to starting the next transfer. an attempt to set the str bit in the ccr0 when abc=1 will cause an error. a write of 1 has no effect on this bit. 1: the dma channel has terminated with an error. 0: the dma channel has not terminated with an error. 21 ? (reserved) this bit is reserved. it must al ways be written as 0. 20 bes source bus error (reset value: 0) 1: a bus error has occurred during the source read cycle. 0: a bus error has not occurred during the source read cycle. 19 bed destination bus error (reset value: 0) 1: a bus error has occurred during the destination write cycle. 0: a bus error has not occurred du ring the destination write cycle. 18 conf configuration error (reset value: 0) 1: a configuration error is present. 0: no configuration error is present. 2 : 0 ? (reserved) this bit is reserved. it must al ways be written as 0. tmp19a71 10-11
tmp19a71 10.2.8 source address register (sar0) 7 6 5 4 3 2 1 0 sar0 bit symbol saddr (0xffff_d608) read/write r/w reset value 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol saddr read/write r/w reset value 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol saddr read/write r/w reset value 0 0 0 0 0 0 0 0 31 30 29 28 27 26 25 24 bit symbol saddr read/write r/w reset value 0 0 0 0 0 0 0 0 bit mnemonic field name description 31 : 0 saddr source address (reset value: ) contains the physical address of the source device. the address changes as programmed in the sa c and trsiz fields in the ccr0 and the sacm field in the dtcr0. tmp19a71 10-12
tmp19a71 10.2.9 destination address register (dar0) 7 6 5 4 3 2 1 0 dar0 bit symbol daddr (0xffff_d60c) read/write r/w reset value 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol daddr read/write r/w reset value 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol daddr read/write r/w reset value 0 0 0 0 0 0 0 0 31 30 29 28 27 26 25 24 bit symbol daddr read/write r/w reset value 0 0 0 0 0 0 0 0 bit mnemonic field name description 31 : 0 daddr destination address (reset value: ) contains the physical address of the destination device. the address changes as programmed in t he dac and trsiz fields in the ccr0 and the dacm field in the dtcr0. tmp19a71 10-13
tmp19a71 10.2.10 byte count register (bcr0) 7 6 5 4 3 2 1 0 bcr0 bit symbol bc (0xffff_d610) read/write r/w reset value 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol bc read/write r/w reset value 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol bc read/write r/w reset value 0 0 0 0 0 0 0 0 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r reset value 0 0 0 0 0 0 0 0 bit mnemonic field name description 23 : 0 bc byte count (reset value: ) contains the number of bytes left to transfer on the dma channel. the count is decremented b y 1, 2 or 4 (as determined by the trsiz field in the ccr0 register) for each successful transfer. tmp19a71 10-14
tmp19a71 10.2.11 dma transfer control register (dtcr0) 7 6 5 4 3 2 1 0 dtcr0 bit symbol - - dacm sacm (0xffff_d618) read/write r r/w reset value 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol - - - - - - - - read/write r reset value 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit symbol - - - - - - - - read/write r reset value 0 0 0 0 0 0 0 0 31 30 29 28 27 26 25 24 bit symbol - - - - - - - - read/write r reset value 0 0 0 0 0 0 0 0 bit mnemonic field name description 5 : 3 dacm destination address count mode selects the manner in which the destination address is incremented or decrement ed. 000: counting begins with bit 0 of the dar0. 001: counting begins with bit 4 of the dar0. 010: counting begins with bit 8 of the dar0. 011: counting begins with bit 12 of the dar0. 100: counting begins with bit 16 of the dar0. 101: reserved 110: reserved 111: reserved 2 : 0 sacm source address count mode selects the manner in which the source address is incremented or decremented. 000: counting begins with bit 0 of the sar0. 001: counting begins with bit 4 of the sar0. 010: counting begins with bit 8 of the sar0. 011: counting begins with bit 12 of the sar0. 100: counting begins with bit 16 of the sar0. 101: reserved 110: reserved 111: reserved tmp19a71 10-15
tmp19a71 10.2.12 data holding register (dhr) 7 6 5 4 3 2 1 0 dhr bit sy mbol dot (0xffff_d70c) read/write r/w reset value 0 0 0 0 0 0 0 0 15 14 13 12 11 10 9 8 bit sy mbol dot read/write r/w reset value 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit sy mbol dot read/write r/w reset value 0 0 0 0 0 0 0 0 31 30 29 28 27 26 25 24 bit sy mbol dot read/write r/w reset value 0 0 0 0 0 0 0 0 bit mnemonic field name description 31 : 0 dot data on transfer (reset value: - ) contains data read from the source address during a dual-address operation. tmp19a71 10-16
tmp19a71 10.3 operation this section describes the operation of the dmac. 10.3.1 overview the dmac is a high-speed 32-bit dma contro ller used to quickly move large blocks of data between i/o peripherals and memory without intervention of the tx19a core processor. (1) devices supported for the source and destination the dmac handles data transfers from memory to memory and between memor y and i/o peripherals. the device from which data is transferred is referred to as a source device, and the device to wh ich data is transferred is referred to as a destination device. both memory and i/o peripherals can be a source or destination device. the dmac supports da ta transfers from memory to i/o peripherals, from i/o peripherals to memory, and from memory to memory, but not from i/o peripherals to i/o peripherals. dma protocols for memory and i/o peri ph erals differ in accessing an i/o peripheral. to access an i/o peripheral, the dmac asserts the dackn (n = channel number) signal to indicate that da ta is being transferred in response to a previous transfer request. because each dma channel has only one dackn signal, the dmac cannot handle data transfers between two i/o peripherals. interrupt requests can be programmed to be a trigger to initiate a dma process instead of requesting an interrupt to the tx19a core processor. if so programmed, the interrupt controller (intc) forwards a dma request to the dmac. the dma request coming from the intc is cleared when the intc receives a dackn from the dmac. consequently, a dma request for a transfer to/from an i/o peripheral is cleared after each dma bus cycle (i.e., every time the number of bytes programmed into the ccrn.trsiz field is transferred). on the other hand, during memory-to-memory transfer, the dackn signal is not asserted until the byte count register (bcrn) reaches zero. ther efore, memory-to-memory transfer can continuously move large blocks of data in response to a single dma request. the tmp19a71 on-chip i/o peripherals ar e hand led as memory. for example, data transfers between the tmp19a71 on-chip i/o peripheral and on-chip memory is discontinued after every dma bus cycle. nonetheless, until the bcrn register reaches zero , the dmac remains in ready state to wait for the next transfer request. data transfer is conti nued until the byte count register (bcrn) reaches zero. tmp19a71 10-17
tmp19a71 (2) exchanging bus mastership (bus arbitration) in response to a dma request, the dmac issues a bus request to the tx19a core processor. when the dmac receives a bus grant signal from the tx19a core processor, it assumes bus mastersh ip to service the dma request. the dmac can select whether or not to use the snoop function in requesting bas m asterhip to the tx19a core processor. the snoop function releases the tx19a core processor?s data bus to the dmac. this selection is made for each channel by programming the sreq bit in the ccrn register. the tx19a core processor may generate a b us release request to the dmac. whether or not to respond to a bus release request from the tx19a core processor is specified for each channel in the reien bit in the ccrn register. the setting of this bit is valid only when the snoop function is not used (greq). when the snoop function is used (sreq), the tx19a core processor cannot generate a bus release request signal. the dmac relinquishes the bus to the tx19a core processor when there is no pen ding dma request to be serviced. note1: the nmi interrupt is left pending while the dmac has control of the bus. note 2: do not place the tmp19a71 in halt mode while the dmac is operating. (3) transfer request generation each dma channel supports two types of request generation methods: internal and ext ernal. internal requests are those generated within the dmac. the dma channel is started as soon as the str bit in the ccrn register is set. the channel immediately requests the bus and begins transferring data. if a channel is programmed for external request and the str bit is set, the int dreqn signal asserted by the intc causes the channel to request the bus and begin a transfer. the dmac can be programmed to recognize a transfer request with the low level of the intdreqn signal. (4) data transfer mode the tmp19a71 dmac supports dual-address transfers, but not single-address transfers. the dual-address mode allows data to be transf erred from memory to memory and between memory and an i/o peripher al. in this mode, the dmac explicitly addresses both the source and destinatio n devices. the dmac also generates a dackn signal when accessing an i/o peripheral. in dual-address mode, a transfer takes place in two dma bus cycles: a source read cycle and a destination write cycle. in the source read cycle, the data being transferred is read from the source address and put into the dmac internal data holding register (dhr). in the destination write cycle, the dmac writes data in the dhr to a destination address. tmp19a71 10-18
tmp19a71 (5) dma channel operation the dmac has eight independent dma chan nels 0 to 7. setting the start (str) bit in the ccrn (n = channel number) enables a particular channel and puts it in ready state. when a dma request is detected in any o f the channels in ready state, the dmac arbitrates for the bus and begins a transfer. when no dma request is pending, the dmac relinquishes the bus to the tx19a core processor and returns to ready state. the channel can terminate by normal completion or from an error of a bus cycle. when a channel terminates, that channel is put in idle state. interrupts can be generated by error termination or by normal channel termination. figure 10.3.1 shows general state transitions of a dma channel. start transfer done idle ready transfer the dmac assumes bus mastership. the dmac gives up bus mastership. the dmac gives up bus matership. the dmac assumes bus mastershi p . figure 10.3.1 dma channel state transitions tmp19a71 10-19
tmp19a71 (6) summary of transfer modes the dmac can perform data transfers a ccording to the combination of mode settings, as shown in the table below. table 10.3.1 dmac mode combinations transfer request edge/level address mode data flow internal (software) ? memory-to-memory memory-to-memory memory- to-i/o external (interrupt) low level intdreqn dual i/o-to-memory (7) address change options address pointers can incre men t, decrement or remain constant. the sac and dac fields in the ccrn respectively se lect address change directions for the source address register (s arn) and the destination address register (darn). while memory addresses can be programmed to increment, decrement or remain constant, i/o addresses must be programmed to remain constant. when an i/o peripheral is selected as the source or destination device, the sac or dac field in the ccrn must be set to 1x (address fixed). the sacm and dacm fields in the dtcrn provides options to program bit positions at which the source and dest ination addresses are incremented or decremented after each transfer. the bit posi tion can be bit 0, 4, 8, 12, or 16. use of bit 0 is the regular increment/decrement mode in which the address changes by 1, 2, or 4, according to the setting of the ccrn.trsiz field. when bit 4, 8, 12 or 16 is selected, the specified bit of the address changes by 1 regardless of the ccrn.trsiz field. two examples of how increment/decrement modes affect address changes are shown below . example 1: when address bit 0 is selected in the sacm field and address bit 4 is selected in the dacm field sac: programmed to increment the source address dac: programmed to increment the destination address trsiz: programmed to a transfer size of 32 bits source address: 0xa000_1000 destination address: 0xb000_0000 sacm: 000 bit 0 is the source address bit at which address increment occurs. dacm: 001 bit 4 is the destination address bit at which address increment occurs. source destination 1st transfer 0xa000_1000 0xb000_0000 2nd transfer 0xa000_1004 0xb000_0010 3rd transfer 0xa000_1008 0xb000_0020 4th transfer 0xa000_100c 0xb000_0030 tmp19a71 10-20
tmp19a71 example 2: when address bit 8 is selected in the sacm field and address bit 0 is selected in the dacm field sac: programmed to decrement the source address dac: programmed to decrement the destination address trsiz: programmed to a transfer size of 16 bits source address: 0xa000_0000 destination address: 0xb000_0000 sacm: 000 bit 8 is the source address bit at which address increment occurs. dacm: 001 bit 0 is the destination address bit at which address increment occurs. source destination 1st transfer 0xa000_0000 0xb000_0000 2nd transfer 0x9fff_ff00 0xafff_fffe 3rd transfer 0x9fff_fe00 0xafff_fffc 4th transfer 0x9fff_fd00 0xafff_fffa 10.3.2 transfer request generation a dma request must be issued for the dmac to initiate a data transfer. each dma channel in the dmac supports two types of request generation method: internal and external. in either request generation mode, once a dma channel is started, a dma request causes the dmac to arbitrate for the bus and begin transferring data. internal request generation a channel is programmed for internal request by clearing the exr bit in the cc rn. in internal request generation mo de, a transfer request is generated as soon as the str bit in the ccrn is set. an internally generated request keeps a transfer request pending until the transfer is complet e. if no transition to a higher-priority dma channel or a bus master occurs, the channel will use 100% of the available bus bandwidth to transfer all data continuously. internally generated requests suppor t o nly memory-to-memory transfer. ? ? external request generation a channel is programmed for external request by setting the exr bit in the ccrn. in ext ernal request generation mode, setting the str bit in the ccrn puts the channel in ready sate. while in ready state, assertion of the intdreqn signal (where n is the channel number) coming from the interrupt controller (intc) causes a transfer request to be generate d. externally generated requests support data transfers from memory to memo ry and between memory and an i/o peripheral. the tmp19a71 can recognize a transfer request with the low level of intdreqn. the transfer size, i.e., the amount of data to be transferred in response to a transfer request, is programmed in the trsiz field in the ccrn. the transfer size can be 32 bits, 16 bits or 8 bits. transfer request generation by intdreqn is described in detail below. tmp19a71 10-21
tmp19a71 (1) t ransfer request coming from the intc a transfer request is removed by assertion of the dackn signal (where n is the channel number). dackn is asserted: 1) when an i/o peripheral bus cycle has completed and 2) when the byte count register (bcrn) has reached zero in memory-to-memory transfer. consequently, a memory-to-i/o or i/o-to-memory transfer request terminates after one dma bus cycle completes, whereas memory-to-memory transfer can continuously move large blocks of data in response to a single dma request. the intc might clear intdreqn before the dmac accepts it and begins a data transfer. it must be noted that, even if that happens, a dma bus cycle might be executed after the interrupt request has been cleared. tmp19a71 10-22
tmp19a71 10.3.3 dma address modes dma transfer is generally performed in eith er of two address mode s: dual-address mode and single-address mode. in du al-address mode, both the source and destination devices are explicitly addressed. in single-address mode, only either the source device or the destination device is explicitly addre ssed. the tmp19a71, however, supports dual-address mode only. in dual-address mode, two bus tr ansfers occur: a read from the source device and a write to the d estination device. in the source read cycle, data is read from the source address and placed in the dmac internal data holdin g register (dhr). then, in the destination write cycle, the data held in the dhr is written to the destination address. dmac data data bus (1) address (2) (2) (1) address bus source device destination device figure 10.3.3 2 dual-address transfer mode the transfer size programmed into the ccrn.trsiz field determines the am ount of data that is transferred from a source device in response to a dma request. the transfer size can be 32 bits, 16 bits or 8 bits. the internal dhr is a 32-bit register that serves as a buffer for the data being transferred from a s ource device to a destination device during dual-address mode. memory accesses occur in a manner to fulfill the ccrn.trsiz setting. memory-to-i/o and i/o-to-memory dma transfers are governed by the setting of the c crn.dps field in addition to the setting of ccrn.trsiz. the dps field defines the port size of a source or destin ation i/o peripheral. the i/o port size can be 32 bits, 16 bits or 8 bits. tmp19a71 10-23
tmp19a71 if the transfer size is equal to the i/o po rt size, an i/o access takes a single read or single write cycle. if the i/o port size is less than the programmed transfer size, the internal 32-bit dhr serves as a buffer for the data being transferred. for example, assume that the transfer size is programmed to 32 bits. if the source i/o port size is 8 bits and the destination memo ry width is 32 bits, then four 8-bit read cycles occur, followed by a 32-bit write cycle. the 32 bits of data are buffered in the dhr until the destination write cycle occurs. source and destination addresses can be progra mmed to increment or decrement after each transfer. the brcn is decremented by trsiz for each data transfer. it is forbidden to program the de vice port size (dps) to a value greater than the dma transfer size (trsiz). the relationships between trsiz and dps are summarized below. table 10.3.2 dma transfer sizes and device port sizes (in dual-address mode) trsiz dps number of i/o bus cycles 0x (32 bits) 0x (32 bits) 1 0x (32 bits) 10 (16 bits) 2 0x (32 bits) 11 (8 bits) 4 10 (16 bits) 0x (32 bi ts) setting prohibited 10 (16 bits) 10 (16 bits) 1 10 (16 bits) 11 (8 bits) 2 11 (8 bits) 0x (32 bi ts) setting prohibited 11 (8 bits) 10 (16 bi ts) setting prohibited 11 (8 bits) 11 (8 bits) 1 tmp19a71 10-24
tmp19a71 10.3.4 dma channel operation each dma channel is started by setting the str bit in the ccrn to 1. once started, the dmac checks the channel setups for co nfiguration errors. if no configuration error is present, the channel enters ready state. when a dma request is detected while in ready state, the dmac arbitrates for the bus and b egins transferring data. the channel can terminate by normal completion or from an error. the state of term ination is indicated in the csrn. channel startup a dma channel is started by setting the str bit in the ccrn. once started, the dmac checks the channel setups for configuration errors. if a configurat ion error is detected, the channel terminates abnormally. if no configuration error is present, the channel enters ready state. once a channel enters ready state, the act bit in the csrn is set to 1. if the channel is programmed for internal requests, the channel requests the bus and starts transferring data immediately. if the channel is programmed for external requests, intdreqn must be asserted before the channel requests the bus. channel termination a dma channel can terminate by normal comple t ion or from an error. the status of a dma operation can be determined by reading the csrn. a channel terminates abnormally if an attempt is made to set the str bit in the cc rn when the nc or abc bit in the csrn is set. normal termination a dma channel terminates by normal completion in the following case. normal complet ion always occurs at the boundary of transfers programmed into the ccrn. trsize field. data transfers have terminated, wi th the bcrn d ecremented to 0. ? ? abnormal termination the following summarizes the cases in which a dma channel terminates from an error . configuration errors a configuration error results when th e chan nel initialization contains inconsistencies or errors. a configuratio n error is reported before any data transfer takes place; therefore, in case of a configuration error, the sarn, darn and bcrn remain unaltered. when a dma channel has terminated from a configuration error, the abc and conf bits in the csrn are set. a configuration error occurs for the following cases: ? both the sio and dio bits in the ccrn are set to 1. ? the ccrn.str bit is set to 1 when the nc or abc bit in the csrn is set to 1. ? the bcrn contains a value that is not an integer multiple of the transfer size programmed into the ccrn.trsiz field. ? the sarn or darn contains a value that is not an integer multiple of the tmp19a71 10-25
tmp19a71 transfer size programmed in to the ccrn.trsiz field. ? the ccrn.trsiz and ccrn.dps fields contain illegal combinations. ? the ccrn.str bit is set to 1 when the bcrn contains a value of zero. ? bus errors when a dma channel has terminated from a bus error, the abc bit and the bes or the bed bit in the csrn are set. ? a bus error has been reported during a source read or destination write cycle. note: the contents of the bcrn, sarn and darn are not guaranteed when a channel has terminated due to a bus error. chapter 18 lists the reserved addresses that, if accessed, cause a bus error. 10.3.5 dma channel priority the dmac provides a fixed priority for th e eight channels, with channel 0 always having the highest priority and channel 7 the lowest. for example, when transfer requests occur on channels 0 and 1 simultan eously, the channel 0 request is serviced first. the channel 1 request is left pending. in order for the channel 1 request to be serviced, it must be maintained until data transfer completes on channel 0. remember that the internally generated request is kept until the servicing of the request is finished. external transfer requests come from the interrupt controller (intc). the intc can program any interrupts to be used as a dma trigger instead of as an interrupt request. if such an interrupt is programmed to be edge-sensitive, the intc internally maintains a transfer request. however, a level-sensitive interrupt is not held in the intc; thus the interrupt request signal must remain asserted until the servicing of the dma request begins. a higher-priority channel always gets the attention of the dmac. if a transfer requ est occurs on channel 0 while a requ est on channel 1 is being serviced, the servicing of the channel 1 request is suspended temporarily in order to service the channel 0 request first. after the channel 0 request has been serviced, channel 1 resumes the remaining data transfer. channel transitions take place at the boundary of a transfer size programmed for the curr ent channel being serviced; that is, after all data in the dhr are written to a destination. interrupts the dmac can generate an interrupt requ est (intdman) to the tx19a core processor upon completion of a channel operation: either by normal channel termination or by abnormal termination of a bus cycle. normal completion interrupt when a channel operation terminates by n ormal completion, the nc bit in the csrn is set to 1. at this time, if the nien bit in the ccrn is set, an interrupt request is generated to the tx19a core processor. ? ? abnormal completion interrupt when a channel operation terminates abnormally, the abc bit in the csrn register is set to 1. at this time, if the abien bit in the ccrn is set, an interrupt request is generated to the tx19a core processor. tmp19a71 10-26
tmp19a71 10.4 dma transfer timing all dmac operations are synchronous to the rising edges of the internal system clock. 10.4.1 dual-address mode memory-to-memory transfer ? ? figure 10.4.1 shows a dma cycle from one external 16-bit memory to another, with th e transfer size programmed to 16 bits. a block of data is transferred until the bcrn register reaches 0. a [23 : 0] cs0 rd wr / hwr tsys dat a data write read d [15 : 0] cs1 figure 10.4.1 memory-to-memory transfer (dual-address mode) memory-to-i/o transfer figure 10.4.2 shows a dma cycle from a 16-bit memory to an 8-bit i/o per ipheral, with the transfer size programmed to 16 bits. read write data data tsys data write a [23 : 0] cs0 cs1 rd wr d [15 : 0] figure 10.4.2 memory-to-i/o transfer (dual-address mode) tmp19a71 10-27
tmp19a71 i/o-to-memory transfer ? figure 10.4.3 shows a dma cycle from an 8- bit i/o periph eral to a 16-bit memory, with the transfer si ze programmed to 16 bits. a [23 : 0] cs0 rd wr / hwr read read dat a tsys dat a dat a write d [15 : 0] cs1 figure 10.4.3 i/o-to-memory transfer (dual-address mode) tmp19a71 10-28
tmp19a71 10.4.2 programming example the following illustrates the programming requir ed to transfer data from an sio receive buffer (sc1buf) to the on-chip ram. (1) dmac settings: dma channel used: channel 0 ? ? ? ? ? ? ? source address: sc1buf destination address: 0xffff_ 9800 (physica l addre ss) number of bytes transferred: 256 (2) sio settings: data format: 8 bits, uart sio channel used: channel 1 transfer rate: 9600 bps dma channel 0 is used for the transfer. the sio1 receive interrupt is used as a trigger to start th e dma channel 0. (3) dma channel 0 settings: dcr 0x8000_0000 /* reset dmac * / imr56 15 7 0 xxxx, xxxx, x100, x100 /* interrupt level = 4 (arbitrary) * / iclr 0xe0 /* ivr [8:0] * / dtcr0 0x0000_0000 /* dacm = 000 * / /* sacm = 000 * / sar0 0xffff_f208 /* physical address of sc1buf */ dar0 0xffff_9800 /* physical address of destination */ bcr0 0x0000_00ff /* 256 (number of bytes to be transferred) / ccr0 0x80c0_5b0f (contents) 3 1 2 7 23 19 1 0 0 0 0 00 011000 000 1 5 1 1 7 3 0 1 0 1 1 x 1 1 x 0001 111 (4) sio channel 1 settings: imr51 31 15 xxxx, xxxx, x101, x000 /* use intrx1 as a dma trigger and select dma ch.0 * / iclr 0xcc /* ivr [8:0]; clear intrx1 * / sc1mod0 0x29 /* uart mode, 8-bit data format * / sc1cr 0x00 br1cr 0xb5 /* @imclk = 28 mhz (approx. 9615 bps) */ br1add 0x05 /* baud rate generator divisor */ tmp19a71 10-29
tmp19a71 11. 16-bit timer/even t counters (tmrbs) the tmp19a71 has a 16-bit timer/event counter consis ting of four identical channels (tmrb0 to tmrb3). each channel has the follow ing three basic operating modes: 16-bit interval timer mode ? ? ? ? ? 16-bit event counter mode 16-bit programmable pulse generation (ppg) mode each channel has capture capability, which enables the following operations: pulse width measurement one-shot pulse generation from an external trigger pulse figure 11.1.1 shows a bl ock diagram of the tmrb0. the main components of a tmrbn block are a 16- bit up-c ounter, two 16-bi t timer registers (one of which is double-buffered), two 16-bit capture registers, two comparators, capture control logic and timer flip-flop logic. each of the four channels (tmrb0 to tmrb3) is independently programmable and functionally equ ivalent except for the differences shown in table 11.1.1 . in the sections that follow, any re ferences to the tmrb0 also apply to other channels. table 11.1.1 pins and registers for the tmrb0 to tmrb3 channel specifications tmrb0 tmrb1 tmrb2 tmrb3 external clock/ capture trigger input tb0in (shared with p93) tb1in (shared with p70) tb2in (shared with p71) tb3in (shared with p72) external pins timer flip-flop output tb0out (shared with p94) tb1out (shar ed w ith p84) tb2out(shared with pa7) tb3out (shared with pb7) timer run register tb0run (0xffff_c700) tb1run (0x ffff_c720) tb2run (0xffff_c740) tb3run (0xffff_c760) timer mode register tb0mod (0xffff_ c704) tb1mod (0xffff_c724) tb2mod (0x ffff_c744) tb3mod (0xffff_c764) timer flip-flop control register tb0ff (0xffff_c708) tb1ff (0xffff_c728) tb2ff (0xffff_c748) tb3ff (0xffff_c768) timer registers tb0reg0 (0xffff_c70c) tb0reg1 (0xffff_c710) tb1reg0 (0xffff_c72c) tb1reg1 (0xffff_c730) tb2reg0 (0xffff_c74c) tb2reg1 (0xffff_c750) tb3reg0 (0xffff_c76c) tb3reg1 (0xffff_c770) capture registers tb0cp0 (0xffff_c714) tb0cp1 (0xffff_c718) tb1cp0 (0xffff_c734) tb1cp1 (0xffff_c738) tb2cp0 (0xffff_c754) tb2cp1 (0xffff_c758) tb3cp0 (0xffff_c774) tb3cp1 (0xffff_c778) registers (addresses) counter tb0cnt (0xffff_c71c) tb1cnt (0xffff_c 73c) tb2cnt (0xffff_c75c) tb3cnt (0xffff_c77c) tmp19a71 11-1
tmp19a71 11.1 block diagram figure 11.1.1 shows a block diagram of the 16-bit timer/event counter (tmrb0). figure 11.1.1 tmrb0 block diagram (tb0cmp0) (tb0cmp1) imbus imbus run/ clear match detect 16-bit comparator imbus im bus tb 0cp0 16-bit timer register tb0reg0 16-bit comparator tb0cp1 register buffer 0 16-bit timer register tb0reg1 match detect count clock tb0mod tb0run selector tb0mod tb0in tb0run tb0mod capture register 0 tb0cp0 tb0mod capture register 1 tb0cp1 16 8 4 2 tb0run timer flip-flop control tb0f f tb0out tmrb0 interrupt inttbcom00/01 timer flip-flop output capture control , 16-bit up-counter tb0cnt 32 64 imclk to inttbcap00/01 1/2 1/64 1/32 1/16 1/8 1/4 imclk imclk/64 tmp19a71 11-2
tmp19a71 11.2 timer components (1) prescaler the tmrb0 has a 6-bit prescaler that slows th e rate of a clocking source to the counter. the prescaler clock source is the imclk selected by the prs2 field in the clkprsc register within the clock generator. the prescaler output clock can be selected from imclk, imclk/2, imcl k/4, imclk/8, imclk/16, imclk/32 and imclk/64 by programming the clk field in the tb0mod register. (2) up-counter (tb0cnt) the tmrb0 contains a 16-bit up-counter, which is driven by the clock selected by the clk field in the tb0mod register. the clock input to the tb0cnt can be selected from seven prescaler outputs (imclk, imclk/2, imclk/4, imcl k/8, im clk/16, imclk/32 an d imclk/64) or the external clock applied to the tb0in pin. the run bit in the tb0run register is used to start the tb0cnt and to stop and clear the tb0cnt. the tb0cnt is cleared to 0000h, if so enabled, when it reaches the value in the tb0reg0 or tb0reg1 register. this clearing can be enabled and disabled by the cle bit in the tb0mod register. if the clearing is disabled, the tb0cnt acts as a free-running counter. if the overflow interrupt is enabled in the ofi bit in the tb0run register, an int errupt (inttbcom00) is genera ted upon a counter overflow. tmp19a71 11-3
tmp19a71 (3) timer registers (tb0reg0, tb0reg1) each timer channel has two 16-bit register s conta ining a time constant. when the up-counter reaches the timer constant value in each timer register, the associated comparator block generates a match-detect signal. each of the timer registers (tb0reg0 , tb0r eg1) can be written with a halfword-load instruction. although it is also possible to use a series of two byte-load instructions, be sure to use a halfword-load instruction while the tb0cnt is counting to prevent an erroneous match detect when only the first byte-load instruction has been executed. to write to the timer register while the tb0cnt is counting and double-buffering is disabled, the write timing must be managed by software. one of the two timer registers, tb0reg0, is double-buffered. the double-buffering funct ion can be enabled and disabled through the programming of the dbe bit in the tb0run register: 0 = disable, 1=enable. if double-buffering is enabled, the tb0reg0 latches a new time constant from the register buffer 0. this takes place when a match is detected between the tb0cnt and the tb0reg1. upon reset, the contents of the tb0reg0 and tb0reg1 are cleared to zero; thus, they must be load ed with valid values befo re the timer can be used. a reset clears the tb0run.dbe bit to 0, disablin g the double-buffering function. to use this function, the tb0run.dbe bit must be set to 1 after loading the tb0reg0 and tb0reg1with time constants. when tb0run.dbe=1, the next time constant can be written to the register buffer. the tb0reg0 and the corresponding register buffer are mapped to the same addre ss (0xffff_c70c). when tb0run.dbe=0, a time constant value is written to both the tb0reg0 and the register buffer . when tb0run.dbe=1, a time constant value is written only to the register buffer. therefore, the double-buffering function should be disabled when writing an initial time constant to each timer register. (4) capture registers (tb0cp0, tb0cp1) the capture registers are 16-bit registers used to latch the value of the up-counter (tb0cnt ). each of the capture registers can be read with a halfword-load instruction. although it is also possible to use a series of two byte-load instructions, it is recommended to use a halfword -load instruction while the timer is counting because the register value may be updated before the second byte-load instruction is executed. the cpm field in the tb0mod register is used to select the timing for latching the tb0 cnt value to the tb0cp0 and tb0cp1. furthermore, an up-counter value can be captured under software control: a write of 0 to the tb0 mod.cp0 bit causes the current tb0cnt value to be latched into the tb0cp0. to use the capture capability, the prescaler must be running (i.e., tb0run.prun=1). tmp19a71 11-4
tmp19a71 (5) comparators (tb0cmp0, tb0cmp1) the tmrb0 contains two 16-bit comparat ors. the tb0cmp0 block compares the output of the up-counter (tb0cnt) with a time constant value in the tb0reg0. the tb0cmp1 block compares the output of the tb0cnt with a time constant value in the tb0reg1. when a match is detected, an interrupt (inttbcom0x) is generated. the tb0cmp0 does not detect a match wh en the tb0reg0 value is 0000h whereas the tb0cmp1 detects a match when tb0reg1=0000h. to use the match detect function of the tb0cmp1, setting tb0mod.cle=1 or tb0ff.invc1=1 is required. however, if tb0reg1 is set to 0000h with tb0mod.cle=1, undefi ned operation will result. (6) timer flip-flop (tb0ff) the timer flip-flop (tb0ff) is toggled, if so enabled, upon assertion of match-detect signa ls from the comparators and latch signals from the capture control logic. the toggling of the tb0ff can be enabled and disabled through the programming of the invl1, invl0, invc1, invc0, and mod bits in the tb0ff register. upon reset, the tb0ff is cleared to 0. a write of 00 to the mod field in the tb0ff causes th e tb0ff to be toggled to the opposite value; a write of 01 to this field sets the tb0ffto 1; and a write of 10 to this field clears the tb0ff to 0. the value of the tb0ff can be driven onto the tb0out pin, which is multiplexed with p94. the port 9 registers (p9cr, p9fr 1) must be programmed to configure the tb0out/p94 pin as an output from the tb0ff. after reset, the tb0out pin outputs 0 until the tb0ff.mod field is set. tmp19a71 11-5
tmp19a71 11.3 register description as shown in table 11.3.1 , the main components of the tmrbn block are a 16-bit up-counter, two 1 6-bit timer registers (one of which is double-buffered), two 16-bit capture registers, two comparators, capture control logic and timer flip-f lop control logic. the 11-byte registers provide control over the operating modes and timer flip-flops. table 11.3.1 tmrb register map (1/2) address bits mnemonic register name 0xffff_c700 8 tb0run tmrb0 run register 0xffff_c704 16(8) tb0mod(l) tmrb0 mode register (low) 0xffff_c705 8 tb0modh tmrb0 mode register high 0xffff_c708 8 tb0ff tmrb0 flip-flop control register 0xffff_c70c 16 tb0reg0 tmrb0 compare register 0 0xffff_c710 16 tb0reg1 tmrb0 compare register 1 0xffff_c714 16 tb0cp0 tmrb0 capture register 0 0xffff_c718 16 tb0cp1 tmrb0 capture register 1 0xffff_c71c 16 tb0cnt tmrb0 counter register 0xffff_c720 8 tb1run tmrb1 run register 0xffff_c724 16(8) tb1mod(l) tmrb1 mode register (low) 0xffff_c725 8 tb1modh tmrb1 mode register high 0xffff_c728 8 tb1ff tmrb1 flip-flop control register 0xffff_c72c 16 tb1reg0 tmrb1 compare register 0 0xffff_c730 16 tb1reg1 tmrb1 compare register 1 0xffff_c734 16 tb1cp0 tmrb1 capture register 0 0xffff_c73c 16 tb1cnt tmrb1 counter register tmp19a71 11-6
tmp19a71 table 11.3.2 tmrb register map (2/2) address bits mnemonic register name 0xffff_c740 8 tb2run tmrb2 run register 0xffff_c744 16(8) tb2mod(l) tmrb2 mode register (low) 0xffff_c745 8 tb2modh tmrb2 mode register high 0xffff_c748 8 tb2ff tmrb2 flip-flop control register 0xffff_c74c 16 tb2reg0 tmrb2 compare register 0 0xffff_c750 16 tb2reg1 tmrb2 compare register 1 0xffff_c754 16 tb2cp0 tmrb2 capture register 0 0xffff_c75c 16 tb2cnt tmrb2 counter register 0xffff_c760 8 tb3run tmrb3 run register 0xffff_c764 16(8) tb3mod(l) tmrb3 mode register (low) 0xffff_c765 8 tb3modh tmrb3 mode register high 0xffff_c768 8 tb3ff tmrb3 flip-flop control register 0xffff_c76c 16 tb3reg0 tmrb3 compare register 0 0xffff_c770 16 tb3reg1 tmrb3 compare register 1 0xffff_c774 16 tb3cp0 tmrb3 capture register 0 0xffff_c77c 16 tb3cnt tmrb3 counter register note 1: although the tbxmod is a 16-bit register, it can be accessed as two 8-bit registers: tbxmodl (low) and tbxmodh (high). note 2: the tbxcp0 and tbxcp1 can be read by two byte-load instructions. however, we recommend using a half word-load instruction while the timer is counting as the register value may be updated between two byte-load instructions. note 3: the tb0reg0 and tb0reg1 can be written by two byte-load instructions. however, we recommend using a half word-load instruction as a match with tb0cnt may be erroneously detected when only the first byte has been written. tmp19a71 11-7
tmp19a71 tmrb0 run register 7 6 5 4 3 2 1 0 bit symbol dbe D trgsel cssel idl prun ofi trun read/write r/w reset value 0 0 0 0 0 0 0 0 function double- buffer 0: disable 1: enable must be set as 0. external trigger 0: rising edge 1: falling edge counter star t 0: software start 1: external trig ger tmrb0 operation 0: stop & keep counter value 1:normal operation prescaler start 0: stop and clear 1:run overflow interrupt 0: disable 1: enable timer star t 0: stop and clear 1:run tb0run (0xff ff_c700) note 1: the difference between stopping the timer by setting idl=0 and trun=0 is that idl=0 preserves the tbxcnt value whereas trun=0 clears the tbxcnt value. note 2: when the cssel bit is set to 1, the tb0cnt starts counting triggered by the tb0in pin input as specified in the trgsel bit. to start counting by the external trigger signal, the trun bit must be set to 1. if trun=0, the counter remains stopped and cleared as in the case of software start. note 3: once the counter is started by an external trigger, the trigger is kept internally. to accept a next external trigger , it is necessary to clear and stop the counter by clearing the trun bit to 0 and then to set trun=1 again. any external triggers accepted before the trun bit is cleared to 0 are ignored. tmp19a71 11-8
tmp19a71 tmrb0 mode register 7 6 5 4 3 2 1 0 bit symbol D D cpm cle clk read/write w r/w reset value D D 0 0 0 000 function capture timing 00: disable 10: latches the counter value into tb0cp0 at rising edges of tb0in and gener ates inttbcap01. latches the counter value into tb0cp1 at falling edges of tb0in and generates inttbca00. others: reserved up-counter clear control 0:clearing d isabled 1: clears u p-counter upon a match with tb0reg1 clock source 000: tb0in pin input (tmrb0 only) 001: imclk 010: imclk/2 011: imclk/4 100: imclk/8 101: imclk/16 110: imclk/32 111: imclk/64 tb0mod(l) (0xff ff_c704) 15 14 13 12 11 10 9 8 bit symbol D D D D D D D cp0 read/write r r/w w reset value 0 0 0 0 0 0 0 1 function m u s t b e set as 0. software capture control 0: software ca pture 1:don?t car e this bit is alw ays read as 1. tb0modh (0xffff_c705) note: this register does not support bit manipulation instructions. tmp19a71 11-9
tmp19a71 tmrb0 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol D D invl1 invl0 invc1 invc0 mod read/write w r/w w reset value D D 0 0 0 0 11 function when the up-counter value is latched into tb0cp1 0: toggle- trigger disabled 1:toggle- trigger enabled when the up-counter value is latched into tb0cp0 0: toggle- trigger disabled 1:toggle- trigger enabled when the up-counter value reaches tb0reg 1 0: toggle- trigger disabled 1: toggle- trigger enabled when the up-counter value reaches tb0reg0 0: toggle- trigger disabled 1:toggle- trigger enabled flip-flop control 00: toggles tb0out (soft ware toggle) 01: sets tb0out to 1 10: clears tb0out to 0 11: don?t care this field is always read as 11. tb0ff (0xff ff_c708) tmrb0 compare register 0 7 6 5 4 3 2 1 0 bit symbol cmp0 read/write r/w reset value 0x00 function when double-buffering is enabled, this register stores the value used for the second comparison. tb0reg0 (0x ffff_c70c) 15 14 13 12 11 10 9 8 bit symbol cmp0 read/write r/w reset value 0x00 function note 1: the tb0cmp0 does not detect a match when tb0reg0=0x0000. note 2: to use the inttbcom0x interrupt, capture operation must be disabled by setting tb0mod.cpm=00. when tb0m od.cpm is set to a value other than 00, no interrupt is generated. however, match detection is performed so that the output on the tb0out pin can be toggled. tmrb0 compare register 1 7 6 5 4 3 2 1 0 bit symbol cmp1 read/write r/w reset value 0x00 function this register stores the value used for comparison. tb0reg1 (0xff ff_c710) 15 14 13 12 11 10 9 8 bit symbol cmp1 read/write r/w reset value 0x00 function note 1: the tb0cmp1 detects a match even when tb0reg1=0x0000. note 2: match detection by the tb0cmp1 requires setting tb0mod.cle=1 or tb0ff.inv1=1. tmp19a71 11-10
tmp19a71 tmrb0 capture register 0 7 6 5 4 3 2 1 0 bit symbol cp0 read/write r reset value 0x00 function capture value 0 of the up-counter (low) tb0cp0 (0xff ff_c714) 15 14 13 12 11 10 9 8 bit symbol cp0 read/write r reset value 0x00 function capture value 0 of the up-counter (high) tmrb0 capture register 1 7 6 5 4 3 2 1 0 bit symbol cp1 read/write r reset value 0x00 function capture value 1 of the up-counter (low) tb0cp1 (0xff ff_c718) 15 14 13 12 11 10 9 8 bit symbol cp1 read/write r reset value 0x00 function capture value 1 of the up-counter (high) tmrb0 counter register 7 6 5 4 3 2 1 0 bit symbol cnt read/write r reset value 0x00 function count value of the up-counter (low) tb0cnt (0x ffff_c71c) 15 14 13 12 11 10 9 8 bit symbol cnt read/write r reset value 0x00 function count value of the up-counter (high) tmp19a71 11-11
tmp19a71 11.4 operating modes the 16-bit timer has the following operation modes: (a) 16-bit inter val timer mode (b) 16- bit event counter mode (c) 16-bit pro grammable pulse generation (ppg) mode the tmrb0 has the capture capability used to latch the value of the counter. the capture capabi lity allows: (d) pulse width measurement (e) one-shot pulse generation using an external trigger pulse 11.4.1 16-bit interval timer mode to accomplish periodic interrupt generation , the interval time is set in the tb0reg1 register, and the inttbcom01 interrupt is enabled. example: setting the 20 s interval timer (imclk: 28 mhz) using inttbcom01 1. tb0run = 0x00; // s top timer 0 2. imr25 = 0x00; // disable inttb com00 imr26 = 0x41; // enable int tbcom01 3. tb0ff = 0x0a; // invc1=1, f f=0 tb0mod = 0x010a; // select prescaler (imclk/2 ) tb0reg1 = 0x0118; // set interval time 4. tb0run = 0x0d; // s tart timer imclk/2 tb0cn t 0x011 8 0x000 0 0x011 8 0x000 0 0x011 8 0x0000 tb0reg1 inttbcom01 tb0ou t 0x0001 20sec 71.4ns 0x0000 0x0001 ??? ??? 0x0001 ??? figure 11.4.1 16-bit interval timer mode tmp19a71 11-12
tmp19a71 11.4.2 16-bit event counter mode this mode is used to count events by interpreting the rising edges of the external counter clock (tb0in) as events. the up-counter counts up on each rising edge of the tb0in pin input. the counter value can be latch ed into a capture register under software control. to determine the number of events (i.e., cycles) counted, the value in the capture register must be read. example: setting the event counter 1. tb0run = 0x00; // s top timer 0 2. imr84 = 0x41; // enable int tbcap00 imr85 = 0x00; // disable inttb cap01 3. tb0ff = 0x03; // disable trigger tb0mod = 0x0124; // select external time, imclk/8 tb0reg1 = 0x0050; // set interval time 4. tb0run = 0x0d; // s tart timer tmp19a71 11-13
tmp19a71 11.4.3 16-bit programmable pulse generation (ppg) mode the 16-bit ppg mode can be used to generate a square wave with any frequency and duty cycle. the pulse can be high-going or low-going, as determined by the initial setting of the timer flip-flop (tb0ff). a square wave is generated by toggling the timer flip-flop (tb0ff) every time the up-c ounter (tb0cnt) reaches the value in each timer register (tb0reg0, tb0reg1). the square-wave output is driven to the tb0out pin. in this mode, the following relationship must be satisfied: (tb0reg0 value) < (tb0reg1 value) tb0reg0 match (inttbcom00 interrupt) tb0reg1 match (inttbcom01 interrupt) tb0out pin figure 11.4.2 ppg output waveform if the double-buffering function is enabled, th e tb0reg0 value can be changed dynamically by writing a new value into the register buffer. upon a match between the tb0reg1 and the tb0cnt, the tb0reg0 latches a new value from the register buffer. the tb0reg0 can be loaded with a new value upon every match thus making it easy to generate a square wave with virtually any duty cycle. q 1 q 2 q 2 q 3 shift into tb0reg1 up-counter = q 1 up-counter = q 2 tb0reg0 match tb0reg1 match tb0reg0 (compare value) re g ister buffer write to tb0reg0 figure 11.4.3 register buffer operation tmp19a71 11-14
tmp19a71 example: setting the event counter with double-buffering 1. tb0run = 0x00; // s top timer 0 2. tb0reg0 = 0x0050; // set interval time tb0reg1 = 0x0 080; 3. tb0run = 0x80; // enable double buffer 4. tb0ff = 0x0e; // initialize f lip-flop tb0mod = 0x010d; // select prescaler (imclk/1 6) 5. p9fr1 = 0x10; // p94 tb0out p9cr = 0x10; // p94 output en able 6. tb0run = 0x8d; // s tart timer tb0cnt #00 #10 0 #01 #10 0 #02 write the next value buffer0 tb0reg0 tb0reg1 tb0cmp (note 1) tb1cmp (note 1) inttbcom00 inttbcom01 tb0out variable duty cycle note 1: internal signal perio d #03 #0 2 value #10 value #00 #01 variable duty cycle #0 2 value #01 figure 11.4.4 programmable pulse generation (ppg) mode tmp19a71 11-15
tmp19a71 11.4.4 pulse width measurement the capture function can be used to measure the pulse width of an external clock. the external clock is applied to the tb0in pin. the up-counter (tb0cnt) is programmed to operate as a free-running counter, clocked by one of the prescaler outputs. the capture function is used to latch the tb0cnt value into the capture registers (tb0cp0, tb0cp1) at the clock rising edge and at the next clock falling edge, respectively. the interrupt controller (intc) should be programmed to generate the inttbcap00 interrupt at the falling edge of the tb0in input. multiplying the counter clock period by the difference between the values captured int o the tb0cp0 and tb0cp1 gives the high pulse width of the tb0in0 clock. for example, if the prescaler output clock has a period of 0.5 s and the difference bet ween the tb0cp0 and tb0cp1 is 100, the high pulse width is calculated as 0.5 s x 100 = 50 s. c4 c3 c2 c1 c2 c1 prescaler output clock tb0in0 input (external clock) capture into tb0cp0 inttbcap00 capture into tb0cp1 c3 c4 figure 11.4.5 pulse width measurement the low pulse width of the external clock can be measured by setting the int tbcap01 interrupt to be generated on the rising edge of the tb0in pin, and multiplying the difference between the tb0cp1 value at c2 and the tb0cp0 value at c3 by the prescaler output clock period. if no edge input occurs on the tb0in pin, this can be detected by a counter overflow. tmp19a71 11-16
tmp19a71 11.4.5 one-shot pulse generation using an external trigger pulse the tmrbn can be used to produce a one-time pulse as follows. (1) t he 16-bit up-counter (tb0cnt) is prog rammed to function as a free-running counter, clocked by one of the prescaler outputs. the tb0in pin is used as an active-high external trigger pulse input for latching the counter value into the capture register (tb0cp0). (2) t he interrupt controller (intc) must be programmed to generate an inttbcap01 interrupt upon detection of a rising edge on the tb0in pin. the tb0reg0 is loaded with the sum of the tb0cp0 value (c) and the pulse delay (d) D i.e., (c) + (d). the tb0reg1 is loaded with the sum of the tb0reg0 value and the pulse width (p) D i.e., (c) + (d) + (p). (3) nex t, the invc0 and invc1 bits in the timer flip-flop control register (tb0ff) are set to 11, so that the timer flip-flo p (tb0ff) will toggle when a match is detected between the tb0cnt and the tb0reg0 and between the tb0cnt and the tb0reg1. with the tb0ff toggled twice, a one-shop pulse is produced. upon a match between the tb0cnt and the tb0reg1, the tmrb0 generates the inttbcom01 interrupt, which must disable the toggle trigger for the tb0ff. figure 11.4.6 depicts one-shot pulse generation, with annotations showing (c), (d) and (p ). tb0out (timer output) pin c + d + p c + d c toggle is disabled for a capture into tb0cp1. toggle is enabled. (p) (d) pulse width delay toggle is enabled. inttbcom01 is generated. the tb0cnt value is latched into tb0cp0. inttbcap01 is generated. counter clock (internal clock) the counter is free-running. tb0in0 input pin (external trigger pulse) tb0reg0 match tb0reg1 match inttbcom00 is generated. figure 11.4.6 one-shop pulse generation (with a delay) tmp19a71 11-17
tmp19a71 example: generating a one-shot pulse with a width of 2 ms an d a delay of 3 ms on assertion of an external trigger pulse on the tb0in pin clocking conditio ns: system clock: 56 mhz prescaler clock: imclk/2 (imclk = fsys/2) settings in the main routine place the counter in free-running mode. 7 6 5 4 3210 select imclk/2 as the counter clock source. tb0mod ? ? 1 0 0010 latch tb0cnt value into tb0cp0 at rising edges of the tb0in input. tb0ff ? ? 0 0 0010 clear tb0ff0 to 0. disable the toggle trigger for tb0ff0. p9ier ? ? ? 1 ? ? ? ? p9cr ? ? ? 1 ? ? ? ? p9fr1 ? ? ? 1 ? ? ? ? configure the p94 pin as tb0out. imr85 x 1 0 0 x 1 0 0 imr25 x 1 0 0 x 0 0 0 enable inttbcap01 and disable inttbcom00. tb0run ? 0 x x 1 1 x 1 start tmrb0. settings in inttbcap01 tb0reg0 tb0cp0 + 3ms/( imclk/2) tb0reg1 tb0reg0 + 2ms /(imclk/2) tb0ff ? ? ? ? 1111 enable the tb0ff0 toggle trigger for tb0reg0 and tb0reg1 matches. imr25 x 1 0 0 x 1 0 0 enable inttbcom00. settings in inttbcom01 tb0ff ? ? ? ? 0011 disable the tb0ff0 toggle trigger for tb0reg0 and tb0reg1 matches. imr25 x 1 0 0 x 0 0 0 disable inttbcom00. x: don't care, ? : no change if no delay is necessary, enable the tb 0ff toggle trigger fo r a capture of the tb0cnt value into the tb0cp0. use th e inttbcap01 interrupt to load the tb0reg1 with a sum of the tb0cp0 value (c) and the pulse width (p) and to enable the tb0ff toggle trigger fo r a match between the tb0cnt and tb0reg1 values. a match generates the inttbcom1 interrupt, which then is to disable the tb0ff toggle trigger. tmp19a71 11-18
tmp19a71 c + p c toggle is enabled. (p) pulse width the tb0cnt value is latched into tb0cp0. inttb0cap01 is generated. counter clock (prescaler output clock) tb0in input (external trigger pulse) tb0reg1 match tb0out (timer output) pin the tb0cnt value is latched into tb0cp1. inttbcom01 is generated. toggle is enabled for a capture into tb0cp0. toggle is left disabled for a capture into tb0cp1 so that it will not be toggled. figure 11.4.7 one-shot pulse generation (without a delay) tmp19a71 11-19
tmp19a71 11.4.6 one-shot pulse generation using an external count start trigger using an external count start trigger enables one-shot pulse generation with a shorter delay . (1) t he 16-bit up-counter (tb0cnt) is programmed to count up on the rising edge of the tb0in pin (tb0run.tregsel=1, tb0run.cssel=1). the tb0reg0 is loaded with the pulse delay (d), and the tb0reg1 is loaded with the sum of the tb0reg0 value (d) and the pulse width (p)?i.e., (d) + (p). (2) t he tb0cnt is programmed to start counting on the rising edge of the external trigger pulse. (3) nex t, the invc0 and invc1 bits in the timer flip-flop control register (tb0ff) are set to 11, so that the timer flip-flop (tb0 ff) will toggle when a match is detected between the tb0cnt and the tb0reg 0 and between the tb0cnt and the tb0reg1. with the tb0ff toggled twice, a one-shot pulse is produced. upon a match between the tb0cnt and the tb0reg1, the tmrb0 generates the inttbcom01 interrupt, which must disabl e the toggle trigger for the tb0ff. figure 11.4.8 depicts one-shot pulse generation, with annotations showing (d) and (p ). tb0out (timer output) pin d + p d 0 toggle is disabled for a cpature into cap1. toggle is enabled. (p) (d) pulse width delay toggle is enabled. inttbcom01 is generated. counter clock (internal clock) the counter starts on the risinge edge of external trigger. tb0in0 input pin (external trigger pulse) tb0rg0 match tb0rg1 match inttbcom00 is generaged. figure 11.4.8 one-shot pulse generation using an external count start trigger (with a delay) tmp19a71 11-20
tmp19a71 12. serial i/o (sio) 12.1 overview the tmp19a71 contains four channels of serial i/o (sio0 to sio3). the sio2 and sio3 can be used in uart mode (asynchronous) and i/ o interface mode (synchronous). the sio0 and sio1 only support uart mode. the sio0 and sio1 do not have the sclk and cts pins; thus an external clock cannot be used as a uart transfer clock in these channels. i/o interface mode mode 0: transmits/rece ives a ser ial clock (sclk) as well as data streams for a synchronous clock mode of operation mode 1: 7 data bits ? ? uart mode mode 2: 8 data bits mode 3: 9 data bits in mode 1 and mode 2, each frame can include a parity bit. in mode 3, the wake-up feature is available for multidrop applications in which a master station is connected to several slave stations through a serial link. figure 12.2.1 shows a block diagram of the sio2. the main components of an sio channel are a clock prescaler, a serial clock generator, a receive bu ffer, a receive controller, a transmit buffer and a transmit controller. each sio channel is independently programmable and functi onally equivalent. in the following sections, any references to the sio2 also apply to the other channels unless otherwise noted. bit 0 1 2 3 4 5 6 start stop bit 0 1 2 3 4 5 6 start stop parity bit 0 1 2 3 4 5 6 bit 0 1 2 3 4 5 6 start stop start stop parity 7 7 7 bit 0 1 2 3 4 5 6 start 8 7 stop bit 0 1 2 3 4 5 6 start stop (wake-up) bit 8 7 bit 8 = 1: address (select code) bit 8 = 0: data mode 0 (i/o interface mode): msb first goes out first mode 1 (7-bit uart mode) mode 2 (8-bit uart mode) mode 3 (9-bit uart mode) without parity with parity without parity with parity 0 bit 7 6 5 4 3 2 1 mode 0 (i/o interface mode): lsb first goes out first 7 bit 0 1 2 3 4 5 6 figure 12.1.1 dat a formats tmp19a71 12-1
tmp19a71 12.2 block diagram (sio2 64 128 2 4 8 16 32 imclk/2 imclk/128 imclk/32 imclk/8 prescaler imclk serial clock generator selector divider imclk/2 imclk/128 imclk/32 imclk/8 selector selector selector baud rate generator 2 tb2out (from tmrb2) i/o interface mode uart mode br2cr
 br2cr  br2cr  br2cr  sc2mod0  sc2mod0  sc2cr  transmit counter (16 for uart) receive counter (16 for uart) receive control serial channel  interrupt control transmit control sc2mod0  receive buffer 1  (shift register) parity control receive buffer 2 (sc2buf) sc2cr  error flag transmit buffer 1 (shift register) transmit buffer 2 (sc2buf) sc2cr  sc2cr    sc2cr  sc2mod0  imclk sclk2 input (shared with  p87) sclk2 output (shared with  p87) rx2 (shared with  p85) tx2 (shared with  p86) cts2 (shared with  p87) interrupt request intrx2 interrupt request inttx2 sioclk txdclk rxdclk sc2mod0  receive fifo im-bus receive control transmit fifo transmit control  fifo interrupt control  interrupt request intrx2 interrupt request inttx2 sc2fr c  sc2ftc  sc2frc   sc2ftc   sc2frc  sc2ftc  to serial channel  interrupt control   figure 12.2.1   sio2 block diagram      tmp19a71   12-2 

tmp19a71 12.3 sio components (sio2) 12.3.1 prescaler the sio2 has a 7-bit prescaler that slows the ra te of a clocking source to the serial clock generator. the prescaler clock source (imclk ) can be programmed in the prs2 bit of the clkprsc located within the clock generator. the prescaler can output four types of cloc ks to the baud rate gen erator: imclk/2, imclk/8 imclk/32 and imclk/128. the serial clock is selectable from several clocks; the prescaler is only enabled when the baud rat e generator output clock is selected as a serial clock. table 12.3.1 shows prescaler outp ut clock resolutions. table 12.3.1 prescaler output clock resolutions fc = 12 mhz (pll output clock) prescaler output clock resolution clock gear value clkprsc.prs1 imclk selection clkpsc.prs2 imclk/2 imclk/8 imclk/32 imclk/128 000 (fsys/2) fc/8 (71.4 ns) fc/32 (0.29 s) fc/128 (1.1 s) fc/512 (4.6 s) 010 (fsys/3) fc/12 (107 ns) fc/48 (0.43 s) fc/192 (1.7 s) fc/768 (6.9 s) 100 (fsys/4) fc/16 (143 ns) fc/64 (0.57 s) fc/256 (2.3 s) fc/1024 (9.1 s) 00 (fc/2) 110 (fsys/5) fc/20 (178 ns) fc/80 (0.71 s) fc/320 (2.9 s) fc/1280 (11.4 s) 000 (fsys/2) fc/16 (143 ns) fc/64 (0.57 s) fc/256 (2.3 s) fc/1024 (9.1 s) 010 (fsys/3) fc/24 (187 ns) fc/96 (0.86 s) fc/384 (3.4 s) fc/1524 (13.7 s) 100 (fsys/4) fc/32 (286 ns) fc/128 (1.1 s) fc/512 (4.6 s) fc/2048 (18.3 s) 01 (fc/4) 110 (fsys/5) fc/40 (357 ns) fc/160 (1.43 s) fc/640 (5.7 s) fc/2560 (22.9 s) 000 (fsys/2) fc/32 (0.29 s) fc/128 (1.1 s) fc/512 (4.6 s) fc/2048 (18.3 s) 010 (fsys/3) fc/48 (0.43 s) fc/192 (1.7 s) fc/768 (6.9 s) fc/3048 (17.4 s) 100 (fsys/4) fc/64 (0.57 s) fc/256 (2.3 s) fc/1024 (9.1 s) fc/4096 (36.6 s) 10 (fc/8) 110 (fsys/5) fc/80 (0.71 s) fc/320 (2.9 s) fc/1280 (11.4 s) fc/5120 (45.8 s) note: do not change the clock gear value while the sio is operating. tmp19a71 12-3
tmp19a71 12.3.2 baud rate generator the frequency used to transmit and receiv e data through the sio2 is derived from the baud rate generator. the clock source for the baud rate generator can be selected from the 7-bit prescaler outputs (imc lk/2, imclk/8, imclk/32, imclk/128) through the programming of the pre bit in the br2cr. the baud rate generator contains a clock di vi der that can divide the selected clock by n (n = 1 to 16) or n+(16-k)/16 ( n = 2 to 15, k = 1 to 15). the clock divisor is programmed into the dvs and br2s bits in the br2cr and the br2k bit in the br2add. i/o interface mode ? i/o interface mode cannot utilize the n + (16 ? k)/16 clock division function. the dvs bit in the br2cr must be cleared to 0. uart mode ? 1) when br2cr.dvs = 0 when the br2cr.dvs bit is cleared, the br2add.br2k field has no meaning or effect. in this case, the baud rate ge nerator input clock is divided down by a value of n (1 to 16) programmed in the br2cr.br2s field. 2) when br2cr.dvs = 1 setting the br2cr.dvs bit to 1 enables the n + (16 ? k)/16 division function. the baud rate generator input clock is di vided down according to the value of n (2 to 15) programmed in the br2cr.br2s field and the value of k (1 to 15) programmed in the br2add.br2k field. note: setting n to 1 or 16 disables the n + (16 k)/16 clock division function. when n = 1 or 16, the br2cr.dvs bit must be cleared to 0. baud rate calculations 1) i/o inter face mode ba ud rate = 2 bau ? when the clock input to the baud rate benerator is imclk/2 (14 mhz) and the baud rat e generator divisor is set to 2, the maximum baud rate is 3.5 mbps. baud rate generator input clock d rate generator divisor tmp19a71 12-4
tmp19a71 2) uart mode baud rate = 16 when the clock input to the baud rate generator is imclk/2 (14 mhz), the maxi mum baud rate is 875 kbps. the baud rate generator can be bypassed if the user wants to use the imclk clock as a serial clock. in this case , the maximum baud rate is 1.75 mbps (at imclk = 28 mhz). baud rate generator input clock r divisor baud rate generato calculation examples ? 1) integra l division (divide-by-n) imclk = 28 mhz baud rate generator input clock: imclk/8 clock divisor n (br2cr.br2s) = 4 br2cr.dvs = 0 clocking conditions system clock : 56 mhz im clk : 28 mhz (divide-by-2) (16-5) 16 5 + imclk/32 16 baud rate = 4 imclk/8 16 = 28 10 6 8 4 16 = 54.7 kbps) note: clearing the br2cr.dvs bit to 0 disables the n + (16 - k)/16 clock division function. at this time, the br2add.br2k field is ignored. 2) n + (16 - k )/16 clock division (uart mode only) imclk = 28 mhz baud rate generator input clock: imclk/32 n (br2cr.br2s) = 5 k (br2add.br2k) = 5 br2cr.dvs = 1 clocking conditions system clock : 56 mhz im clk : 28 mhz (divide-by-2) baud rate = = 28 10 6 32 (5 + ) 16 = 9615 (bps) 11 16 tmp19a71 12-5
tmp19a71 the sio2 can use an external clock as a se rial clock, bypassing the baud rate generator. when an external clock is us ed, the baud rate is determined as shown below. using an external clock as a serial clock ? 1) i/o inter face mode baud rate = external clock input when double-buffering is used, the external clock period must be greater than 12/ fsys. therefore, when fsys = 56 mhz, the maximum baud rate is 4.7 mbps (56 12). when double-buffering is not used, the e xernal clock period must be greater than 16/fsys. therefore, when fsys = 56 mhz, the maximum baud rate is 3.5 mbps (56 16). 2) uart mode baud rate = external clock input 16 the external clock input must be greater than or equal to 4/fsys. therefore, when fsys = 56 mhz, the maximum baud rate is 875 kbps (56 4 16). table 12.3.2 and table 12.3.3 show baud rate setting examples in uart mode. tmp19a71 12-6
tmp19a71 table 12.3.2 uart baud rate selection logic baud rate (bps) generated baud rate (bps) prescaler divisor n correction value error (%) 1200 1202 imclk/128 11 10 0.16 2400 2404 imclk/128 5 5 0.16 4800 4808 imclk/32 11 10 0.16 9600 9615 imclk/32 5 5 0.16 14400 14403 imclk/8 15 13 0.02 19200 19231 imclk/8 11 10 0.16 28800 28689 imclk/8 7 6 0.39 31250 31250 imclk/8 7 none 0 38400 38462 imclk/8 5 5 0.16 57600 57613 imclk/2 15 13 0.02 115200 115702 imclk/2 7 7 0.44 230400 229508 imclk/2 3 3 0.39 note 1: this table assumes: fsys = 56 mhz, imclk = fsys/2 (28 mhz). note 2: when a baud rate slower than 600 bps is used, the input clock must be tmrb2. table 12.3.3 ua rt baud rate selection tb2reg1 values when the tmrb2 timer trigger output (internal tb2out) is used (tmrb2 input clock = imclk/4) imclk baud rate (bps) 28 mhz 20 mhz 14 mhz 10 mhz 7 mhz 100 4375 3125 2188 1563 1094 150 2916 2084 1458 1042 730 200 2188 1563 1094 781 547 300 1458 1042 729 521 365 400 1094 781 547 391 273 500 875 625 438 313 219 600 729 521 365 260 182 when the timer tmrb2 is used to generate a seri al cloc k, the baud rate is determined by the following equation: baud rate = imclk tb2reg1 4 16 (when the tmrb2 clock source is imclk/4) note: in i/o interface mode, the sio2 and sio3 cannot utilize the trigger output signal (internal) from the timer tmrb2 as a serial clock. tmp19a71 12-7
tmp19a71 12.3.3 serial clock generator this block generates a basic clock that cont rols the transmit and receive operations. i/o interface mode if the sclk2 pin is configured as an output by clearing the sc2cr.ioc bit to 0, the o utput clock from the baud rate generator is divided by two to generate the basic clock. if the sclk2 pin is configured as an inpu t by sett ing the sc2cr.ioc bit to 1, the external sclk2 clock is used as the basic clock; the sc2cr.sclks bit determines the active clock edge. ? uart mode the basic clock (sioclk) is selected from a clock produced by the baud rate gen erator, the system clock (imclk/2), the internal output signal from the timer tmrb2, and the external sclk2 clock, according to the setting of the sc2mod0.sc field. ? 12.3.4 receive counter the receive counter is a 4-bit binary up-counter used in uart mode. this counter is clocked by sioclk. the receiver utilizes 16 clocks for each received bit, and oversamples each bit three times around their center (with 7th to 9th clocks). the value of a bit is determined by voting logic which takes the value of the majority of three samples. 12.3.5 receive controller i/o interface mode if the sclk2 pin is configured as an outp ut b y clearing the sc2cr.ioc bit to 0, the receive controller samples the rx2 input at the rising edge of the shift clock driven out from the sclk2 pin. if the sclk2 pin is configured as an inpu t by sett ing the sc2cr.ioc bit to 1, the receive controller samples the rx2 input at either the rising or falling edge of the sclk2 clock, as programmed in the sc2cr.sclks bit. ? uart mode the receive controller uses 16 clocks for re ceivin g the start bit. it samples the 7th to 9th clocks to determine by voting logic whether or not the correct start bit is received. receive operation is started upon reception of the correct start bit. ? 12.3.6 receive buffer the receive buffer is double-buffered to prevent overrun errors. received data is serially shifted bit by bit into receive buffer 1. when a whole frame is loaded into receive buffer 1, it is transferred to receive buffer 2 (sc2buf), and the intrx2 is generated. at this time, the receive buffer full flag (sc2mod2.rbfll) is set to 1, indicatig that receive buffer 2 contains valid data. the tx19a core processor reads a frame from receive buffer 2 (sc2buf), causing the receive buffer full flag (sc2mod2.rbfll) to be cleared to 0. receive buffer 1 tmp19a71 12-8
tmp19a71 can accept a new frame before the tx19a co re processor picks up the previous frame in receive buffer 2 (sc2buf). if the sclk2 pin is configured as an output in i/o interface mode, receive buffer 2 (sc 2buf) can be enabled or disabled by programming the wbuf bit in the sc2mod2. disabling receive buffer 2 (double-buffer ing) enables handshaking during data transfer; the sio2 stops outputting the sclk2 clock every time a single frame has been transmitted. in this case, the tx19a core processor reads a frame from receive buffer 1, causing the output of the sclk2 clock to be restarted. if receive buffer 2 (double-buffering) is enabled, a received frame is transferred from receive buffer 1 to receive buffer 2. once a next frame is received resulting in both receive buffers 1 and 2 containing valid data, the sio2 stops outputting the sclk2 clock. when the tx19a core processor reads a frame from receive buffer 2, the frame stored in receive buffer 1 is transferred to receive buffer 2, causing a receive-done interrupt (intrx2) to occur and the sio2 to restart outputting the sclk2 clock. consequently, no overrun error occurs if the sclk2 pin is configured as an output in i/o interface mode, regardless of the setting of the sc2mod2.wbuf bit. note: in sclk output mode, the oeer flag in the sc2cr has no meaning; it is read as undefined. when exiting sclk output mode, first read the sc2cr to initialize this flag. in other operating modes, receive buffer 2 is always enabled to improve per formance during continuous transfer. however, the tx19a core processor must read receive buffer 2 (sc2buf) before receive buffer 1 is filled with a new frame. otherwise, an overrun error occurs, causing the frame previously stored in receive buffer 1 to be lost. even in that case, the contents of receive buffer 2 and the sc2cr.rb8 bit are preserved. the sc2cr.rb8 bit holds the parity bit in 8-bit uart mode and the most sign ificant bit in 9-bit uart mode. in 9-bit uart mode, the receiver wake-up feature can be enabled for slave contr ollers by setting the sc2mod0.wu bit to 1. the receiver generates the intrx2 interrupt only when the sc2cr.rb8 bit is set to 1. tmp19a71 12-9
tmp19a71 12.3.7 transmit counter the transmit counter is a 4-bit binary up -counter used in uart mode. like the receive counter, the transmit counter is also clocked by sioclk. the transmitter generates a transmit clock (txdclk) pulse every 16 sioclk pulses. sioclk txdclk 15 16 1 2 4 5 67 8 910 11 12 13 14 15 16 3 1 2 figure 12.3.1 t ransmit clock generation 12.3.8 transmit controller i/o interface mode ? if the sclk2 pin is configured as an output by clearing the sc2cr.ioc bit to 0, the tr ansmit controller shifts out each bit in the transmit buffer to the tx2 pin at the falling edge of the shift clock driven out on the sclk2 pin. if the sclk2 pin is configured as an inpu t by sett ing the sc2cr.ioc bit to 1, the transmit controller shifts out each bit in the transmit buffer to the tx2 pin at either the rising or falling edge of the sclk2 input, as programmed in the sc2cr.sclks bit. uart mode once the tx19a core processor loads a frame into the transmit buffer, the transmit controller begins transmission a t the next falling edge of txdclk, producing a transmit shift clock. ? tmp19a71 12-10
tmp19a71 handshaking (sio2 and sio3 only) the sio2 has a clear-to-send (cts2) pin. if the cts operation is enabled, a frame can be transmitted only when the cts2 input is low. this feature can be used for flow control to prevent overrun errors in the receiver. the sc2mod0.ctse bit enables and disables the cts operation. if the cts2 pin goes high in the middle of a transmission, the transmit controller stops tra nsmission upon completion of the current frame until cts2 goes low again. if so enabled, the transmit controller generates the inttx2 interrupt to notify the tx19a core processor that the transmit buffer is empty. after the next frame is loaded into the transmit buffer, the transmit controller remains in an idle state until it detects cts2 going low. although the sio2 does not have the rts pin, any general-purpose port pins can serve as the rts pin. the receiving device uses the rts output to control the cts2 input of the transmitting device. once the receiving device has received a frame, rts should be set to high in the receive-done interrupt handler to temporarily stop the transmitting device from sending the next frame. this way, the user can easily implement a two-way handshake protocol. rx2 rts2 (any port) receiving device transmitting device tx2 cts2 tmp19a71 tmp19a71 figure 12.3.2 ha ndshaking signals 3 2 16 1 15 start bit bit 0 (1) (2) period no transmission during this 14 13 write to transmit buffer cts2 14 15 16 1 2 3 sioclk txdclk tx2 note 1: if the cts2 signal goes high in the middle of a transmission, the transmitter sotps transmission after the current frame has been sent. note 2: the transmitter starts transmission at the first fa llin g edge of the txdclk clock after the cts2 signal goes low. figure 12.3.3 clear-to-send (cts) signal timing tmp19a71 12-11
tmp19a71 12.3.9 generating a waveform with a 50% duty cycle when the uart bit in the sc2mod1 is set to 1, the uart output and the internal transmit signal are ored, as shown in figure 12.3.4 . when the baud rate generator divisor is set to a v alue of n in uart mode, a waveform with a 50% duty cycle is generated. the duty ratio varies when the n+ (16-k)/16 clock division function is used. figure 12.3.4 waveform generation wi th a 50% duty cycle (divide-by-n) uart output internal signal output with a 50% duty cycle 12.3.10 accuracy of waveform generation with a 50% duty cycle (a) when the baud rate generator di visor is set to a value of n a waveform with a 50% duty cycle is generated. (b) whe n the n + (16 - k)/16 clock division function is used the duty ratio is calculated as the ratio of low width to high width as shown below. k = 0 to 8 : (k n) + 8 - k) (n + 1): 8 (n + 1) k = 8 to 16 : 8 n: (k - 8) n + (16 - k) (n + 1) the largest deviation occurs when k = 8 and n = 1. in this case, the ratio of low width to high widt h is 8:16 (33%:67%). example: generating 9600 bps by using the n + (16 ? k)/16 clock division function system clock : fsys = 56 mhz (imclk = 28 mhz) input clock : imclk/32 = 875 khz baud rate : 9615 bps (n = 5, k = 5) duty ratio : low:high = 43:48 = 47.25%:52.75% tmp19a71 12-12
tmp19a71 12.3.11 transmit buffer the transmit buffer is double-buffered. doub le-buffering can be enabled or disabled by programming the wbuf bit in the sc2mod2. if double-buffering is enabled, a frame is first written to transmit buffer 2 (sc2buf) and then transferred to transmit buffer 1 (shift register), causing the inttx2 interrupt to occur and the transmit buffer empty flag (sc2mod2.tbemp) to be set. this flag indicates that transmit buffer 2 is empty and a next transmit frame can be written. writing a next frame to transmit buffer 2 clears the tbemp flag. when the sclk2 pin is configured as an input in i/o interface mode, an underrun error occurs upon completion of transmitting a fram e from transmit buffer 1 if a next frame is not written to transmit buffer 2 before the clock pulse for the next frame is input. an underrun error is indicated by the parity/und errun flag (perr) in the sc2cr. when the sclk2 pin is configured as an output in i/o interface mode, the sio2 stops outputting the sclk2 clock after transmitting a frame which has been transferred from transmit buffer 2 to transmit buffer 1. in this mode, therefore, no underrun error occurs. note: when the sclk2 pin is configured as an output in i/o interface mode, the perr flag in the sc2cr has no meaning; it is read as undefined. when exiting sclk output mode, first read the sc2cr to initialize this flag. if double-buffering is disabled, the tx19a core processor writes a transmit frame to transmit buffer 1. the inttx2 interrupt is generated upon completion of transmission. if handshaking is required, transmit buffer 2 must be disabled by clearing the wbuf bit in t he sc2mod2. for continuous transmi ssion without handshaking, transmit buffer 2 can be enabled by setting the wbuf bit to improve performance. when double-buffering is not used, do not write to transmit buffer 1 while a frame is being transmitted. 12.3.12 parity controller for transmit operations, setting the sc2cr.pe bit to 1 enables parity generation in 7- and 8-bit uart modes. the sc2cr.even bit selects either even or odd parity. if enabled, the parity controller automati cally generates parity for the frame in the transm it buffer (sc2buf). in 7-bit uart mode, the tb7 bit in the sc2buf holds the parity bit. in 8-bit uart mode, the tb8 bit in the sc2mod holds the parity bit. the parity bit is set after the frame has been transmitted. the sc2cr.pe and sc2cr.even bits must be programmed prior to a write to the transmit buffer. for receive operations, the pari t y controller automatically co mputes the expected parity when a frame in receive buffer 1 is transferred to receive buffer 2 (sc2buf). the received parity bit is compared to the sc2buf.rb7 bit in 7-bit uart mode and to the sc2cr.rb8 bit in 8-bit uart mode. if a frame is received with incorrect parity, the sc2cr.perr bit is set. in i/o interface mode, the sc2cr.perr bit in dicates an under run error rather than a parity error. tmp19a71 12-13
tmp19a71 12.3.13 error flags the sio2 has the following three error flags for improved data reception reliability. 1. overrun error: sc2cr.oerr in uart and i/o interface mode, an ove rrun err or is reported with the oerr bit set to 1 if all bits of a new frame are received before the current frame is read from the receive buffer. reading the flag causes it to be cleared. note that an overrun error can only be cleared by re ading the receive buffer or executing a software reset using the sc2mod2.swrst. when the sclk2 pin is configured as an output in i/o interface mod e, however, no overrun error occurs so that the oerr flag has no meaning and is read as undefined. 2. parity error/underrun error: sc2cr.perr in uart mode, this flag indicates wh et her a parity error has occurred. a parity error is reported when the parity bit attached to a received frame does not match the expected parity computed from the frame. reading the flag causes it to be cleared. in i/o interface mode, this flag indicates whether an underrun error has occurr ed, only when double-buffering (transmit buffer 2) is enabled (sc2mod2.wbuf = 1) with the sclk2 pin configured as an input. an underrun error is reported upon completion of transmitting a frame from transmit buffer 1 if a next frame is not written to transmit buffer 2 before the clock pulse for the next frame is input. when the sclk2 pin is configured as an output, no underrun error occurs so that the perr flag na s no meaning and is read as undefined. reading the flag causes it to be cleared. 3. fr aming error: sc2cr.ferr in uart mode, this flag indicates whether a framing error has occurred. a fram ing error is reported if a 0 is detected where a stop bit was expected. (the middle three of the 16 samples are used to determine the bit value.) reading the flag causes it to be cleared. during reception, only a single stop bit is detected regardless of the setting of the sblen bit in the sc2mod2. tmp19a71 12-14
tmp19a71 table 12.3.4 error flags operating mode error flag function oerr overrun error flag perr parity error flag uart ferr framing er ror flag oerr overrun error flag underrun error flag (wbuf=1) perr fixed to 0 (wbuf=0) i/o interface (sclk input) ferr fixed to 0 oerr undefined perr undefined i/o interface (sclk output) ferr fixed to 0 12.3.14 bit transfer sequence the drchg bit in serial mode control register 2 (sc2mod2) determines whether the most significant bit (msb) or least significant bit (lsb) is transmitted first in i/o interface mode. the setting of the drchg bit cannot be mo dified while the sio is transferring data. 12.3.15 stop bit length the sblen bit in the sc2mod2 determines the number of stop bits (1 or 2) used in uart mode. tmp19a71 12-15
tmp19a71 12.3.16 status flag the rbfll bit in the sc2mod2 indicates whether receive buffer 2 is full when double-buffering is enabled (sc2mod2.wbuf = 1). it is set to 1 once a received frame is transferred from receive buffer 1 to rece ive buffer 2. the rbfll bit is cleared to 0 when the tx19a core processor or dmac reads data from receive buffer 2. when wbuf = 0, the rbfll bit has no meaning; it should not be used as a status flag. the tbemp bit in the sc2mod2 indicates whether transmit buffer 2 is empty when double-buffering is enabled (sc2mod2.wbuf = 1). it is set to 1 once a transmit frame is transferred from transmit buffer 2 to transmit buffer 1 (shift register). the tbemp bit is cleared to 0 when the tx19a core processor or dmac stores data in transmit buffer 2. when wbuf = 0, the tb emp bit has no meaning; it should not be used as a status flag. 12.3.17 transmit/receive buffer configuration table 12.3.5 t ransmit/receive buffer configuration wbuf = 0 wbuf = 1 transmit single double uart receive double double transmit single double i/o interface (sclk input) receive double double transmit single double i/o interface (sclk output) receive single double tmp19a71 12-16
tmp19a71 12.3.18 transmit/receive fifo buffers as shown in figure 12.3.5 and figure 12.3.6 , a total of 16 bytes of fifo buffer is ava ilable both in uart mode (excluding 9-bit uart mode) and i/o interface mode. when the fifo buffer is used for both tr ansmit and receive operations, 8 bytes are assigned to each. when the fifo buffer is required for only transmit or receive, all the 16 bytes can be used as transmit or receive buffers. receive buffer 1 (shift register) receive buffer 2 (sc2buf) rx2 (p85) sc2fcnf. cnfg2 receive fifo internal bus figure 12.3.5 receive fifo block diagram transmit buffer 2 (sc2buf) transmit buffer 1 (shift register) tx2 (p86) sc2fcnf. cnfg2 transmit fifo internal bus figure 12.3.6 transmit fifo block diagram tmp19a71 12-17
tmp19a71 in sclk output mode (in i/o interface mode ), writin g data in the transmit buffer starts a transmission in hal f-duplex mode. if the transmit buffer contains no data, transmit operation is halted. setting the rx e bit in the sc2mod0 to 1 starts receive operation in half-duplex mode. receive operation can be stopped by clearing the sc2mod0.rxe bit to 0 before reading the last frame. when the fifo buffer is enabled, the following sequence must be executed to stop receive operation in half-duplex mode. 1. after receiving the last frame but one, disable the receive fifo. 2. after receiving the last frame, disable receive operation by clearing the sc 2mod0.rxe bit. 3. enable the receive fifo with the same conditions as before. (when the transmit fifo is enab led, it should be kept enabled.) 4. read the data in the fifo. 5. disable the receive fifo. 6. read the last frame. operation in full-duplex mode is the same as transmit operation in half-duplex mode. the received data must be read before a next transmit frame has been written. note 1: when the transmit fifo is used, do not access registers other than the sc2buf, sc2frs, and sc2fts. note 2: when the receive fifo is used, do not access the sc2cr or write to the sc2frs. note 3: do not write to the transmit fifo when it is full. before writing to the transmit fifo, check the num ber of bytes stored in the transmit fifo by using the sc2fts.tlvl field. note 4: do not read from the receive fifo when it is empty. before reading the receive fifo, check the num ber of bytes stored in the receive fifo by using the sc2frs.rlvl field. tmp19a71 12-18
tmp19a71 12.3.19 signal generation timing (1) i/o interface mode table 12.3.6 si gnal generation timing in i/o interface mode receive operation sclk output mode immediately after the rising edge of the last sclk pulse interrupt (wbuf = 0) sclk input mode immediately after the rising or falling edge of the last sclk pulse, as programm ed sclk output mode immediately after the rising edge of the last sclk pulse (i.e., immediately afte r the frame is tr ansferred to receive buffer 2) or immediately after the frame is read from receive buffer 2 interrupt (wbuf = 1) sclk input mode immediately after the rising or falling edge of the last sclk pulse, as programm ed (i.e., immediately afte r the frame is transferred to receive buffer 2) overrun error sclk input mode immediately after t he rising or falling edge of the last sclk pulse, a s programmed transmit operation sclk output mode immediately after the rising edge of the last sclk pulse interrupt (wbuf = 0) sclk input mode immediately after the rising or falling edge of the last sclk pulse, as programm ed sclk output mode immediately after the rising edge of the last sclk pulse or immediately after the frame is transferred to transmit buffer 1 interrupt (wbuf = 1) sclk input mode immediately after the rising or falling edge of the last sclk pulse, as programm ed or immediately afte r the frame is transferred to transmit buffer 1 underrun error (wbuf=1) sclk input mode immediately after the rising or falling edge of the next sclk pulse, as programm ed note 1: do not modify any control registers while data is being transmitted or received (receive operation is enabled). note 2: do not disable receive operation (sc2mod0.rxe = 0) while data is being received. tmp19a71 12-19
tmp19a71 (2) uart mode table 12.3.7 si gnal generation timing in uart mode receive operation mode 9 data bits 8 data bits with parity 8 data bits with no parity, 7 data bits w ith parity 7 data bits wih no parity interrupt middle of the first stop bit middle of the first stop bit middle of the first stop bit framing error middle of the stop bit middl e of the stop bit middle of the stop bit parity error ? middle of the last bit (i.e., parit y bit) middle of the last bit (i.e., parity bit) overrun error middle of the stop bit middl e of the stop bit middle of the stop bit transmit operation mode 9 data bits 8 data bits with parity 8 data bits with no parity, 7 data bits w ith parity, 7 data bits with no parity interrupt (wbuf = 0) simultaneously with transferring th e stop bit simultaneously with transferring th e stop bit simultaneously with transferring the stop bit interrupt (wbuf = 1) immediately after the frame is transfer red to transmit buffer 1 (i.e., simultaneously with transferring the start bit) immediately after the frame is transfer red to transmit buffer 1 (i.e., simultaneously with transferring the start bit) immediately after the frame is transferre d to transmit buffer 1 (i.e., simultaneously with transferring the start bit) note 1: do not modify any control registers while data is being transmitted or received (or receive operation is enabled). note 2: do not disable receive operation (sc2mod0.rxe = 0) while data is being received. note 3: the ?middle? in the above table means the 9th bit of sioclk. tmp19a71 12-20
tmp19a71 12.4 register descripsion (only c hannel 2 registers are described.) table 12.4.1 sio register map address bits mnemonic register name 0xffff_c480 8 sc0mod0 serial 0 mode control register 0 0xffff_c481 8 sc0mod1 serial 0 mode control register 1 0xffff_c484 8 sc0cr serial 0 control register 0xffff_c485 8 sc0mod2 serial 0 mode control register 2 0xffff_c488 8 br0cr baud rate generator control register (sio0) 0xffff_c489 8 br0add baud rate generator additional control register (sio0) 0xffff_c490 8 sc0buf serial 0 tr ansmit/receive buf fer register 0xffff_c494 8 sc0fcnf serial 0 fifo configuration register 0xffff_c498 8 sc0ftc serial 0 fifo transmit control register 0xffff_c499 8 sc0frc serial 0 fifo receive control register 0xffff_c49c 8 sc0fts serial 0 fifo transmit status register 0xffff_c49d 8 sc0frs serial 0 fifo receive status register 0xffff_c4a0 8 sc1mod0 serial 1 mode control register 0 0xffff_c4a1 8 sc1mod1 serial 1 mode control register 1 0xffff_c4a4 8 sc1cr serial 1 control register 0xffff_c4a5 8 sc1mod2 serial 1 mode control register 2 0xffff_c4a8 8 br1cr baud rate generator control register (sio1) 0xffff_c4a9 8 br1add baud rate generato r additional control register (sio1) 0xffff_c4b0 8 sc1buf serial 1 tr ansmit/receive buf fer register 0xffff_c4b4 8 sc1fcnf serial 1 fifo configuration register 0xffff_c4b8 8 sc1ftc serial 1 fifo transmit control register 0xffff_c4b9 8 sc1frc serial 1 fifo receive control register 0xffff_c4bc 8 sc1fts serial 1 fifo transmit status register 0xffff_c4bd 8 sc1frs serial 1 fifo receive status register note: although these registers are 8-bit wide, two registers at consecutive addresses can be accessed simultaneously with a 16-bi t access instruction. tmp19a71 12-21
tmp19a71 address bits mnemonic register name 0xffff_c4c0 8 sc2mod0 serial 2 mode control register 0 0xffff_c4c1 8 sc2mod1 serial 2 mode control register 1 0xffff_c4c4 8 sc2cr serial 2 control register 0xffff_c4c5 8 sc2mod2 serial 2 mode control register 2 0xffff_c4c8 8 br2cr baud rate generator control register (sio2) 0xffff_c4c9 8 br2add baud rate generator additional control register (sio2) 0xffff_c4d0 8 sc2buf serial 2 tr ansmit/receive buf fer register 0xffff_c4d4 8 sc2fcnf serial 2 fifo configuration register 0xffff_c4d8 8 sc2ftc serial 2 fifo transmit control register 0xffff_c4d9 8 sc2frc serial 2 fifo receive control register 0xffff_c4dc 8 sc2fts serial 2 fifo transmit status register 0xffff_c4dd 8 sc2frs serial 2 fifo receive status register 0xffff_c4e0 8 sc3mod0 serial 3 mode control register 0 0xffff_c4e1 8 sc3mod1 serial 3 mode control register 1 0xffff_c4e4 8 sc3cr serial 3 control register 0xffff_c4e5 8 sc3mod2 serial 3 mode control register 2 0xffff_c4e8 8 br3cr baud rate generator control register (sio3) 0xffff_c4e9 8 br3add baud rate generato r additional control register (sio3) 0xffff_c4e0 8 sc3buf serial 3 tr ansmit/receive buf fer register 0xffff_c4f4 8 sc3fcnf serial 3 fifo configuration register 0xffff_c4f8 8 sc3ftc serial 3 fifo transmit control register 0xffff_c4f9 8 sc3frc serial 3 fifo receive control register 0xffff_c4fc 8 sc3fts serial 3 fifo transmit status register 0xffff_c4fd 8 sc3frs serial 3 fifo receive status register note: although these registers are 8-bit wide, two registers at consecutive addresses can be accessed simultaneously with a 16-bi t access instruction. tmp19a71 12-22
tmp19a71 serial 2 mode control register 0 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm sc read/write r/w reset value 0 0 0 0 0 0 0 0 function bit 8 of a transmitted character handshake control 0: disable cts operation 1: enable cts operation receive control 0: disable 1: enable wake-up function 0: disable 1: enable serial transfer mode 00: i/o interface mode (for si o2, sio3 only) 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial clock (for uart) 00: timer tb2out 01: baud rate generator 10: internal clock (imclk) 11: external clock (sclk2 input) (for sio2, sio3 only) sc2mod0 (0xffff_c4c0) wake-up function 9-bit uart mode other modes 0 interrupt on every received frame 1 interrupt only when rb8 = 1 don?t care 0 disable (accept data streams at all times) 1 enable handshake ( cts ) control (for sio2, sio3 only) note 1: in i/o interface mode, the serial control register (sc2cr) is used to select a serial clock. note 2: like the sio2, the sio0, sio1 and sio3 allows use of the timer tb2out as a serial clock. note 3: the sc2mod0, sc2mod1 and sc2mod2 registers must be set with the rxe bit cleared to 0. after setti ng these registers, set the rxe bit to 1. note 4: during transmit operation in half-duplex mode (sc2mod1.fdpx=0) in i/o interface mode (sc2m od0.sm=00), do not set the rxe bit to 1. note 5: the tb8 bit is not double-buffered. before writing to this bit, make sure that double-buffering is disable d and no transmit operation is in progress. tmp19a71 12-23
tmp19a71 serial 2 mode control register 1 7 6 5 4 3 2 1 0 bit symbol D fdpx D uart D D D D read/write r/w r/w r/w r/w w reset value 0 0 0 0 0 0 0 0 function sync method 0: half duplex 1: full duplex uart output 0: normal 1: 50% dut y cycle sc2mod1 (0xffff_c4c1) note: when the n + (16 - k)/16 clock division function is used, the duty ratio varies with the value of k. tmp19a71 12-24
tmp19a71 serial 2 mode control register 2 7 6 5 4 3 2 1 0 bit symbol tbemp rbfll txrun sblen drchg wbuf swrst read/write r r/w reset value 1 0 0 0 0 0 00 function transmit buffer empt y flag 0: full 1: empty receive buffer full flag 0: empty 1: full transmit-in -prog ress flag 0: stopped 1: trans- mitting number of stop bits 0: 1 bit 1: 2 bits bit sequence 0: lsb first 1: msb first double- buffering 0: disable 1: enable software reset a write of 10 followed b y a write of 01 sc2mod2 (0xffff_c4c5) symbol function swrst a write of 10 followed by a write of 01 to this fi eld r esets the module, thus initializing the rxe bit in the sc2mod0, the tbemp, rbfll and txrun bits in the sc2mod2, the oerr, perr and ferr bis in the sc2cr, and the internal circuits. wbuf enables or disables double-buf fering for transmit (sclk output or input) or receive (sclk output) operation in i/o interface mode and transmit oper ation in uart mode. for any other modes of operation, double-buffering is always enabled. drchg specifies the bit transfer sequence in i/o inte rfa ce mode. in uart mode, the lsb is always transferred first. sblen specifies the number of transmit stop bits in ua r t mode. for receive operation, a single stop bit is used regardless of the setting of this bit. txrun a status flag indicating whether transmit shift operat ion is in progre ss. when this bit is set to 1, transmit operation is in progress. when this bit is cleared to 0, transmit operation is completed (if tbemp = 1) or the trnamit buffer contains a next frame and is ready for transmission (if tbemp= 0). rbfll a flag indicating whether receive buffer 2 is fu ll. the rbfll bit is set to 1 once a received frame is transferred from receive buffer 1 to receive bu ffer 2. it is cleared when the frame is read from receive buffer 2. when double-buffering is disabled, the rbfll bit has no meaning. tbemp a flag indicating whether transmit buffer 2 is empt y. the tbemp bit is set to 1 once a frame is transferred from transmit buffer 2 to transmit buffer 1. it is cleared when a next frame is written to transmit buffer 2. when double-buffering is disabled, the tbemp bit has no meaning. note 1: if the module needs to be reset while it is transmitting data, two consecutive software reset sequences (i.e., 10, 01, 10, 01) must be executed. note 2: this register does not support bit manipulation instructions. tmp19a71 12-25
tmp19a71 serial 2 control register 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc read/write r r/w r (cleared when read) r/w sc2cr (0xffff_c4c4) reset value 0 0 0 0 0 0 0 0 1: error has occurred. function bit 8 of a received character parity type 0: odd 1: even parity 0: enable 1: disable overrun parity/ underru n framing 0: sclk2 1: sclk2 0: baud rate generato r 1: sclk2 input input clock in i/o interface mode (for ch2, ch3 only) framing error flag parity error/underrun error flag overrun error flag 0 data is transmitted/received on the sclk2 rising edge. note 1: all error flags are cleared to 0 when read. note 2: this register does not support bit manipulation instructions. note 3: the sc2cr.ferr bit should not be polled; instead, it should be read in the intrx2 interrupt routine before the receive buffer is read. for details, see the example in ? 12.5.3 8-bit uart mode ?. 1 data is transmitted/received on the sclk2 falling edge. active edge for sclk2 input (for ch2, ch3 only) patiy type 0 baud rate generator 1 sclk2 pin input 0 odd parity 1 even parity these bits are cleared to 0 when read. tmp19a71 12-26
tmp19a71 baud rate generator control register 7 6 5 4 3 2 1 0 bit symbol dvs pre br2s read/write r/w reset value 0 br2cr (0xffff_c4c8) 0 0 0 0 0 0 0 function must be written as 0. n + (16 ? k)/16 division function 0: disable 1: enable 00: imclk/2 01: imclk/8 10: imclk/32 11: imclk/128 clock divisor value n clock source for baud rate generator 00 internal clock imclk/2 01 internal clock imclk/8 10 internal clock imclk/32 11 internal clock imclk/128 baud rate generator additional control register 7 6 5 4 3 2 1 0 bit symbol br2k read/write r/w reset value 0 0 0 0 0 0 0 0 function value k in n + 16 ? k)/16 clock divisor value for the baud rate generator br2cr.dvs = 1 br2cr.dvs = 0 br2add (0xffff_c4c9) br2cr. br2s br2add. br2k 0000 (n = 16) to 0001 (n = 1) 0010 (n = 2) to 1111 (n = 15) 0001 (n = 1 ) (uart only) to 1111 n = 15 0000 n = 16 0000 prohibited prohibited divide by n 0001(k = 1) divide by n to 1111(k = 15 ) prohibited divide by n + 16 k)(16 ? note 1: the baud rate generator divisor cannot be set to 1 in uart mode if the n + (16 ? k)/16 clock division function is enabled. in i/o interface mode, do not set the baud rate generator divisor to 1; setting the divisor to 1 will cause incorrect operation. note 2: to use the n + (16 ? k)/16 clock division function, the value of k must be programmed in the br2 add.br2k field before setting the br2cr.dvs bit to 1. however, the n + (16 ? k)/16 clock division function is not usable when br2cr.br2s = 0000 (n = 16) or 0001 (n = 1). note 3: the n + (16 ? k)/16 clock division function can only be used in uart mode. in i/o interface mode, it must be disa bled by clearing the br2cr.dvs bit to 0. tmp19a71 12-27
tmp19a71 serial transmit/receive buffer register 7 6 5 4 3 2 1 0 bit symbol tb read/write w reset value 0 0 0 0 0 0 0 0 function transmit buffer sc2buf (0xffff_c4d0) 7 6 5 4 3 2 1 0 bit symbol rb read/write r reset value 0 0 0 0 0 0 0 0 function receive buffer note: in i/o interface mode (sc2mod0.sm = 0), do not write to the transmit buffer during receive operation in half-duplex mode (sc2mod1.fdpx = 0). tmp19a71 12-28
tmp19a71 serial 2 fifo configuration register 7 6 5 4 3 2 1 0 bit symbol D D D D D D cnfg read/write r r/w reset value 0 0 0 0 0 0 00 function sc2fcnf (0xffff_c4d4) fifo 00: disable 01: transmit (16 bytes) 10: receive (16 bytes) 11: transmit/receive (8 b ytes each) note: for continuous transmit/receive operations using the fifo, double-buffering must be enabled (sc2mod2.wbuf=1). serial 2 fifo receive control register 7 6 5 4 3 2 1 0 bit symbol ril rfis rfcl rfie D read/write r/w w r/w r reset value 0000 0 0 0 0 sc2frc (0xffff_c4d9) function interrupt level 0000: interrupt is generated when the receive fifo reaches 1 byte. 0001: interrupt is generated when the receive fifo reaches 2 bytes. 0010: interrupt is generated when the receive fif o reaches 3 bytes. 0011: interrupt is generated when the receive fif o reachs 4 bytes. ? 1111: interrupt is generated when the receive fif o reaches 16 bytes. setting has no effect when cnfg=00/01. the most significant bit must be cleared to 0 w hen cnfg=11. interrupt condition 0: interrupt generated only when ril=rlvl 1: interrupt generated w hen ril Q rlvl fifo clear sett ing this bit to 1 clears fifo value. (this bit is always read as 0.) receive fi fo interrupt 0: disable 1: enable rfis: when rfis=0, a receive fifo interrupt is generated onl y when the number of bytes stored in the receive fifo set in the sc2frs.rlvl matches the interrupt generation level set in the sc2frc.ril. when rfis=1, a receive fifo interrupt is generated when the number of bytes stored in the receive fifo set in the sc2frs.rlvl is equal to or greater than the interrupt generation level set in the sc2frc.ril. note: this register does not support bit manipulation instructions. tmp19a71 12-29
tmp19a71 serial 2 fifo transmit control register 7 6 5 4 3 2 1 0 bit symbol til tfis tfcl tfie D read/write r/w w r/w r reset value 0111 0 0 0 0 sc2ftc (0xffff_c4d8) function interrupt level 0000: interrupt is generated when the transmit fifo reaches 1 byte. 0001: interrupt is generated when the transmit fif o reaches 2 bytes. 0010: interrupt is generated when the transmit fifo reaches 3 byes. 0011: interrupt is generated when the transmit fifo reaches 4 bytes. ? 1111: interrupt is generated when the transmit fifo reaches 16 bytes. setting has no effect when cnfg=00/10. the most significant bit must be cleared to 0 w hen cnfg=11. interrupt condition 0: interrupt generated only when til=tlvl. 1: interrupt generated w hen til R tlvl fifo clear setting this bit to 1 clears the fifo value. (this bit is a lways read as 0.) transmit fi fo interrupt 0 di sable 1: enable tfis: when tfis=0, a transmit fifo interrupt is generated only when the number of bytes stored in the transmit fifo set in the sc2fts.tlvl matches the interrupt generation level set in the sc2ftc.til. when tfis=1, a transmit fifo interrupt is generated when the number of bytes stored in the transmit fifo set in the sc2fts.tlvl is equal to or smaller than the interrupt generation level set in the sc2ftc.til. note: this register does not support bit manipulation instructions. rlvl=00000 receive fifo: 0 bytes rlvl=00001 receive fifo: 1 byte rlvl=10000 receive fifo: 16 bytes rlvl=00011 receive fifo: 3 bytes rlvl=00010 receive fifo: 2 bytes n5n5n5 data received data received data received data received data received fifo data read fifo data read fifo data read fifo data read fifo data read >! interrupt generated (rfis=1) >! interrupt generated (rfis=1) >! interrupt generated (rfis=1) interrupt generated >" (rfis=0/1) tlvl=10000 transmit fifo: 16 bytes tlvl=01111 transmit fifo: 15 bytes tlvl=00000 receive fifo: 0 bytes tlvl=01101 receive fifo: 13 bytes tlvl=01110 transmit fifo: 14 bytes n5n5n5 data transmitted data transmitted data transmitted data transmitted data transmitted fifo data written fifo data written fifo data written fifo data written fifo data written >! interrupt generated (tfis=1) >! interrupt generated (tfis=1) >! interrupt generated (tfis=1) interrupt generated >" (tfis=0/1) when sc2frc.ril=0001 when sc2ftc.til=1110 figure 12.4.1 exam ple of interrupt generaton timing when using fifo tmp19a71  12-30
tmp19a71 serial 2 fifo receive status register 7 6 5 4 3 2 1 0 bit symbol rur D D rlvl read/write r reset value 0 0 0 00000 function this bit is set to 1 w hen the receive fifo is full. can be read as 0. can be read as 0. receive fifo byte count 00000: 0 bytes 00001: 1 byte 00010: 2 bytes 00011: 3 bytes ? 10000: 16 bytes rur: the rur bit is set to 1 if an attempt to store a new val ue is made when the receive fifo is already full. this bit is cleared to 0 when it is read while the receive fifo buffer is not full. note: this register does not support bit manipulation instructions. serial 2 fifo transmit status register tur: the tur bit is set to 1 when the transmit fifo beco mes empty. when the first byte is stored in the transmit fofo, it is immediately transferr ed to the transfer buffer (sc2buf), c ausing the transmit fifo to become empty and the tur bit to be set to 1. this bit is automat ically cleared to 0 when data is written to the transmit fifo. 7 6 5 4 3 2 1 0 bit symbol tur D D tlvl read/write r reset value 1 sc2frs (0xffff_c4dd) sc2fts (0xffff_c4dc) 0 0 00000 function this bit is set to 1 w hen the transmit fifo is empty. can be read as 0. can be read as 0. transmit fifo byte count 00000: 0 bytes 00001: 1 byte 00010: 2 bytes 00011: 3 bytes ? 10000: 16 bytes tmp19a71 12-31
tmp19a71 12.5 operating modes 12.5.1 i/o interface mode i/o interface mode utilizes a synchronizat ion clock (sclk), which can be configured for either output mode in which the sclk clock is driven out from the tmp19a71 or input mode in which the sclk clock is supplied externally. (1) transmit operation (half-duplex) sclk output mode when transmit double-buffering is disabled (sc2mod2.wbuf = 0) in sclk output m ode, each time the tx19a core processor writes a frame to the transmit buffer, the 8 bits of the frame are shifted out on the txd2 pin, and the synchronization clock is driven out from the sclk2 pin. when all the bits have been shifted out, the inttx2 interrupt is generated. when transmit double-buffering is enabled (sc2mod2.wbuf = 1), a frame is transf erred from transmit buffer 2 to transmit buffer 1 (shift register) once the tx19a core processor writes the frame to transmit buffer 2 when no data is being transmitted or the last frame in transmit buffer 1 has been sent. at this time, the transmit buffer empty flag (sc2mod2.tbemp) is set to 1 and the inttx2 interrupt is generated. if there is no data to be transferred from transmit buffer 2 to transmit buffer 1, however, the inttx2 interrupt is not generated and sclk2 output is stopped. transmit data write timing sclk2 output bit 0 bit 6 bit 7 bit 1 tx2 (inttx2) bit 0 tbrun figure 12.5.1 t ransmit operation in i/o interface mode (sclk output mode, double-buffering disabled) transmit data write timing sclk2 output bit 0 bit 6 bit 7 bit 1 tx2 (inttx2) bit 0 tbrun tbemp figure 12.5.2 t ransmit operation in i/o interface mode (sclk output mode, double-buffer enabled, data in transmit buffer 2) tmp19a71 12-32
tmp19a71 transmit data write timing sclk2 output bit 0 bit 6 bit 7 bit 1 tx2 (inttx2) tbrun tbemp figure 12.5.3 t ransmit operation in i/o interface mode (sclk output mode, double-buffering enabled, no data in transmit buffer 2) sclk input mode when transmit double-buffering is disabled (sc2mod2.wbuf = 0) in sclk input m ode, the 8 bits of a frame in the transmit buffer are shifted out on the tx2 pin when the sclk2 input becomes active (i .e., the first rising or falling edge, as programmed) with transmit data written in the transmit buffer. the tx19a core processor must load a next frame into the transmit buffer by point a (shown in figure 12.5.4 ). when transmit double-buffering is enabled (sc2mod2.wbuf = 1), a frame is transf erred from transmit buffer 2 to transmit buffer 1 (shift register) once the tx19a core processor writes the frame to transmit buffer 2 before the sclk2 input becomes active or once the last frame in transmit buffer 1 has been sent. at this time, the transmit buffer empt y flag (sc2mod2.tbemp) is set to 1 and the inttx2 interrupt is generated. if the sclk2 input becomes active before a frame is written to transmit buffer 2, an underrun error occurs and 8 bits of dummy data (0xff) are sent although the internal bit counter starts counting. sclk2 input (sclks = 0: rising edge) sclk2 input (sclks = 1: falling edge) bit 0 bit 1 tx2 (inttx2) bit 5 bit 6 bit 7 transmit data write timing bit 0 bit 1 a figure 12.5.4 t ransmit operation in i/o interface mode (sclk input mode, double-bufferig disabled) tmp19a71 12-33
tmp19a71 sclk2 input (sclks = 0: rising edge) sclk2 input (sclks = 1: falling edge) bit 0 bit 1 tx2 (inttx2) bit 5 bit 6 bit 7 transmit data write timing bit 0 bit 1 a tbrun tbemp figure 12.5.5 t ransmit operation in i/o interface mode (sclk input mode, double-buffering enabled, data in transmit buffer 2) sclk2 input (sclks = 0: rising edge) sclk2 input: (sclks = 1: falling edge) bit 0 bit 1 tx2 (inttx2) bit 5 bit 6 bit 7 transmit data write timing 1 a tbrun tbemp perr (underrun error) figure 12.5.6 t ransmit operation in i/o interface mode (sclk input mode, double-buffering enabled, no data in transmit buffer 2) tmp19a71 12-34
tmp19a71 (2) receive operation (half-duplex) sclk output mode when receive double-buffering is disabled (sc2mod2.wbuf = 0) in sclk output m ode, each time the tx19a core processor picks up the frame in receive buffer 1, the synchronization clock is driven out from the sclk2 pin to shift the next frame into receive buffer 1. when a whole-8-bit frame has been received in receive buffer 1, the intrx2 interrupt is generated. the sclk output is initiated by setting the sc2mod0.rxe bit to 1. when rece ive double-buffering is enabled (sc2mod2.wbuf = 1), the frame received first is transferred to receive buffer 2 and then a next frame is received into receive buffer 1. once a frame is transferred from receive buffer 1 to receive buffer 2, the receive buffer full flag (sc2mod2.rbfull) is set to 1 and the intrx2 interrupt is generated. after a frame has been transferred to receive buffer 2, the tx19a core proc essor or dmac should read it before all 8 bits of a next frame are received. otherwise, the intrx2 interrupt is not generated and sclk2 output is stopped. if the tx19a core processor or dmac subsequently reads the frame in receive buffer 2 in this state, the next frame is transferred from receive buffer 1 to receive buffer 2, generating the intrx2 interrupt to restart receive operation. receive data read timing sclk2 output bit 0 bit 6 bit 7 bit 1 rx2 (intrx2) bit 0 figure 12.5.7 re ceive operation in i/o interface mode (sclk output mode, double-buffering disabled) receive data read timing sclk2 output bit 0 bit 6 bit 7 bit 1 rx2 (intrx2) bit 0 bit7 rbfull figure 12.5.8 re ceive operation in i/o interface mode (sclk output mode, double-buffering enabled, reading receive buffer 2) tmp19a71 12-35
tmp19a71 receive data read timing sclk2 output bit 0 bit 6 bit 7 bit 1 rx2 (intrx2) bit7 rbfull figure 12.5.9 re ceive operation in i/o interface mode (sclk output mode, double-buffering enabled, not reading receive buffer 2) sclk input mode in sclk input mode, receive double-buffering is always enabled. a received frame is transferred to receive buffer 2 so that a next frame can be received continuously into receive buffer 1. the intrx2 interrupt is generated every time a frame is transferred from rec eive buffer 1 to receive buffer 2. sclk2 input (sclks = 0: rising edge) sclk2 input (sclks = 1: falling edge) bit 0 bit 1 rx2 (intrx2) bit 5 bit 6 bit 7 receive data read timing bit 0 rbfull figure 12.5.10 receive ope ration in i/o interface mode (sclk input mode, reading receive buffer 2) sclk2 input (sclks = 0: rising edge) sclk2 input (sclks = 1: falling edge) bit 0 bit 1 rx2 (intrx2) bit 5 bit 6 bit 7 receive data read timing bit 0 rbfull oerr figure 12.5.11 receive operation in i/o interface mode (sclk input mode, not reading receive buffer 2) tmp19a71 12-36
tmp19a71 note: to perform receive operation, the sc2mod0.rxe bit must be set to 1 in both sclk input and sclk output modes. (3) transmit/receive operation (full-duplex) setting the sc2mod1.fdpx2 bit to 1 e nables full-duplex communication. sclk output mode when transmit/receive double-bufferig is disabled (sc2mod2.wbuf = 0) in scl k output mode, each time the tx19a core processor writes a frame to the transmit buffer, the synchronization clock is driven out from the sclk2 pin to shift an 8-bit frame into receive buffer 1, generating the intrx2 interrupt. at the same time, the frame written to the transmit buffer is shifted out on the tx2 pin. when all the bits have been shifted out, the transmit-done interrupt (inttx2) is generated and sclk2 output is stopped. when the tx19a core processor subsequently picks up the frame in the receive buffer and writes a next frame to the transmit buffer, next transm it/receive operation starts, regardless of whether the tx19a core processor first reads the receive buffer or writes data to the transmit buffer. when transmit/receive double-buffering is enabled (sc2mod2.wbuf = 1), each tim e the tx19a core processor writes a frame to transmit buffer 2, the synchronization clock is driven out from the sclk2 pin to shift an 8-bit frame into receive buffer 1; it is then transferred to receive buffer 2, generating the intrx2 interrupt. at the same time, the frame stored in transmit buffer 1 is shifted out on the txd2 pin. when all the bits have been shifted out, the transmit-done interrupt (inttx2) is generated and the next frame is transferred from transmit buffer 2 to transmit buffer 1. durnig the above sequence, sclk output is stopped if transmit buffer 2 becomes empty (sc2mod2.tbemp = 1) or if receive buffer 2 still contains data (sc2mod2.rbfull = 1). when the tx19a core processor suqsequently picks up the frame in receive buffer 2 and writes a next frame to transmit buffer 2, sclk2 output is restarted so that next transmit/receive operation starts. receive data read timing sclk2 output bit 0 bit 6 bit 7 bit 1 tx2 (inttx2) bit 0 transmit data w rite timing (intrx2) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rx2 bit 0 bit 5 bit 1 figure 12.5.12 t ransmit/receive operation in i/o interface mode (sclk output mode, double-buffering disabled) tmp19a71 12-37
tmp19a71 receive data read timing sclk2 output bit 0 bit 6 bit 7 bit 1 tx2 (inttx2) bit 0 transmit data w rite timing (intrx2) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rx2 bit 0 bit 5 bit 1 figure 12.5.13 t ransmit/receive operation in i/o interface mode (sclk output mode, double-buffering enabled, no next data) receive data read timing sclk2 output bit 0 bit 6 bit 7 bit 1 tx2 (inttx2) transmit data w rite timing (intrx2) bit 5 bit 0 bit 6 bit 7 bit 1 rx2 bit 5 figure 12.5.14 t ransmit/receive operation in i/o interface mode (sclk output mode, double-buffering enabled, continuous transfer) tmp19a71 12-38
tmp19a71 sclk input mode when transmit double-buffering is disabled (sc2mod2. wbuf = 0) in sclk input mode (receive double-buffering is always enabled in this mode), the tx19a core processor must write a frame to the transmit buffer before the sclk2 input becomes avtive. the 8 bits of a frame in th e transmit buffer are shifted out on the tx2 pin, and the 8 bits of a received frame are shifted into receive buffer 1, synchronous to the programmed edge of th e sclk2 input. when all the bits have been shifted out, the transmit-done inte rrupt (inttx2) is generated. when all the bits have been received, the frame is transferred from receive buffer 1 to receive buffer 2, generating the intrx2 interrupt. the tx19a core processor must load a next frame into the transmit buffer before the sclk signal for the next frame is input (i.e., by point a shown in figure 12.5.15 below). the tx19a core processor must also pick up the fram e in receive buffer 2 before a next frame has been received. when transmit/receive double-buffering is enabled (sc2mod2.wbuf = 1), a fram e is transferred from transmit buffer 2 to transmit buffer 1 once the last frame in transmit buffer 1 has been sent. at this time, the inttx2 interrupt is generated. when the 8-bit frame, received in parallel with transmission, has been shifted into receive buffer 1, it is transferred to receive buffer 2, generating the intrx2 interrupt. when the sclk2 is subsequently activated, the frame stored in transmit buffer 1 is shifted out while a next frame is received into receive buffer 1. if the tx19a core processor does not read the frame from receive buffer 2 before the last bit of a next frame is received, an overrun error occurs. if the tx19a core processor does not write a fr ame to transmit buffer 2 before the sclk2 input is subsequently activated, an underrun error occurs. a receive data read timing sclk2 input bit 0 bit 6 bit 7 bit 1 tx2 (inttx2) bit 0 transmit data w rite timing (intrx2) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rx2 bit 0 bit 5 bit 1 figure 12.5.15 t ransmit/receive operation in i/o interface mode (sclk input mode, double-buffering disabled) tmp19a71 12-39
tmp19a71 receive data read timing sclk2 input bit 0 bit 6 bit 7 bit 1 tx2 (inttx2) bit 0 transmit data w rite timing (intrx2) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rx2 bit 0 bit 5 bit 1 figure 12.5.16 t ransmit/receive operation in i/o interface mode (sclk input mode, double-buffering enabled, no error occurred) receive data read timing sclk2 input bit 0 bit 6 bit 7 bit 1 tx2 (inttx2) bit 0 transmit data w rite timing (intrx2) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rx2 bit 0 bit 5 bit 1 perr (underrun error) figure 12.5.17 t ransmit/receive operation in i/o interface mode (sclk input mode, double-buffering enabled, an underrun error occurred) tmp19a71 12-40
tmp19a71 12.5.2 7-bit uart mode setting the sm field in the sc2mod0 to 01 puts the sio2 in 7-bit uart mode. in this mode, the parity bit can be added to the transmitted frame, and the receiver can perform a parity check on incoming data. parity can be enabled and disabled through the programming of the pe bit in the sc2cr. when the pe bit is set to 1 to enable parity, the sc2cr.even bit selects even or odd parity. the sblen bit in the sc2mod2 specifies the number of stop bits. example: transmitting 7-bit uart frames with an even-parity bit start bit 0 1 2 3 5 4 6 even parity stop clocking conditions: system clock: : 56 mhz imbus clock : 1/2 (28 mhz) prescaler clock : imclk/32 transfer rate : 4800 bps (fsys = 56 mhz) 7 6 5 4 3 2 1 0 p8cr ? 1 ? ? ? ? ? ? p8fr1 ? 1 ? ? ? ? ? ? configure the p86 pin as tx2. sc2mod0 x 0 ? x 0 1 0 1 select 7-bit uart mode. sc2cr x 1 1 x x x 0 0 select even parity. br2cr 0 1 1 0 1 0 x 1 n=11, and k is valid. imclk/32 br2add 0 0 0 0 1 0 1 0 set the transfer rate to 4800 bps. (k = 10) imr52 ? 1 0 0 ? 1 0 0 enable the inttx2 interrupt and set its priority level to 4. sc2buf x * * * * * * * load the transmit buffer with a frame. note: x = don?t care, ? : no change 12.5.3 8-bit uart mode setting the sm field in the sc2mod0 to 10 puts the sio2 in 8-bit uart mode. in this mode, the parity bit can be added to the transmitted frame, and the receiver can perform a parity check on incoming data. parity can be enabled and disabled through the programming of the pe bit in the sc2cr. when the pe bit is set to 1 to enable parity, the sc2cr.even bit selects even or odd parity. example: transmitting 8-bit uart frames with an odd-parity bit start bit 0 1 2 3 5 4 6 odd parity stop 7 clocking conditions system clock : 56 mhz high-speed clock gear : 1/2 (28 mhz) prescaler clock : imclk/32 transfer rate : 9600 bps (fsys = 56 mhz) tmp19a71 12-41
tmp19a71 ? ? settings in the main routine 7 6 5 4 3 2 1 0 p8ier ? ? 0 ? ? ? ? ? p8fr1 ? ? 1 ? ? ? ? ? configure the p85 pin as rx2. sc2mod0 ? 0 0 x 1 0 0 1 select 8-bit uart mode. sc2cr x 0 1 x x x x x select odd parity. br2cr 0 1 1 0 0 1 0 1 n=5, and k is valid. br2add 0 0 0 0 0 1 0 1 set the transfer rate to 9600 bps. (k = 5) imr53 ? 1 0 0 ? 1 0 0 enable the intrx2 interrupt and set its priority level to 4. sc2mod0 ? ? 1 x ? ? ? ? enable reception. example of interrupt routine processing iclr 0 1 1 0 1 0 1 0 0 clear the interrupt request. reg. sc2cr and 0x1c if reg. 0 then error reg. sc2buf read received data. end of interrupt processing note: x = don?t care, ? : no change check for errors. tmp19a71  12-42
tmp19a71 12.5.4 9-bit uart mode setting the sm field in the sc2mod0 to 11 puts the sio2 in 9-bit uart mode. in this mode, the parity bit cannot be used and must be disabled by clearing the sc2cr.pe bit to 0. for transmit operation, the most-significant bit (9th bit) is stored in the tb8 bit in the sc 2mod0. for receive operation, the most-significant bit is stored in the rb8 bit in the sc2cr. reads and writes from and to the transmit and receive buffers must be done with the most-significant bit first, followed by the sc2buf. the sblen bit in the sc2mod2 specifies the number of stop bits. wake-up feature in 9-bit uart mode, the wake-up feature can be enabled for slave controllers by setting th e wu bit in the sc2mod0 to 1. wh en this feature is enabled, the intrx2 interrupt is generated only when sc2cr.rb8 = 1. tx2 master slave 1 slave 2 slave 3 rx2 tx2 rx2 tx2 tx2 rx2 rx2 note: the tx2 pin of a slave controller must be configured as an open-drain output by programming the port 8 open-drain control register (p8odcr). figure 12.5.18 seri al link using the wake-up feature tmp19a71 12-43
tmp19a71 protocol (1) put all the master and slave controllers in 9-bit uart mode. (2) ena ble the receiver in each slave controller by setting the sc2mod0.wu bit to 1. (3) t he master controller transmits an 8-bit address frame (i.e., select code) that identifies a slave controller. the most-significant bit (tb8) of an address frame is a 1. slave controller select code start bit 0 1 2 3 5 4 6 stop 7 8 ?1? (4) each sl ave controller compares the received address to its station address and clears the wu bit to 0 if they match. (5) t he master controller transmits a block of data to the selected salve controller (with sc2mod.wu = 0). the most-significant bit (tb8) of a data frame is a 0. data ?0? start bit 0 1 2 3 5 4 6 stop 7 bit 8 (6) slave controllers not addressed (with sc2m od. wu = 1) continue to monitor the data stream but discard any frames with the most -significant bit (rb8) cleared to 0. thus, the receive-done interrupt (intrx2) is not generated. the addressed slave controller (with sc2mod.wu = 0) can transmit data to th e mater controller to notify that is has successfully receiv ed the message. example: connecting a master controller with two slave controllers through a serial link using the imclk/2 clock as a serial clock tx2 master slave 1 slave 2 select code 00000001 rx2 tx2 rx2 tx2 rx2 select code 00001010 tmp19a71 12-44
tmp19a71 3) master controller setings main routine p8ier ? 1 0 ? ? ? ? ? p8cr ? 1 0 ? ? ? ? ? configure the p86 pin as tx2 and the p85 pin as rx2. p8fr1 ? 1 1 ? ? ? ? ? imr53 ? 1 0 0 ? 1 0 1 enable intrx2 and set its interrupt level to 5. imr52 ? 1 0 0 ? 1 0 0 enable inttx2 and set its interrupt level to 4. sc2mod0 1 0 1 0 1 1 1 0 select 9-bit uart mode and select imclk as a serial clock. sc2buf 0 0 0 0 0 0 0 1 load the select code for slave 1. interrupt routine (inttx2) iclr 0 1 1 0 1 0 0 0 0 clear the interrupt request. sc2mod0 0 ? ? ? ? ? ? ? clear the tb8 bit to 0. sc2buf * * * * * * * * load transmit data. end of interrupt processing 4) slave controller settin gs main routine p8ier ? 1 0 ? ? ? ? ? p8cr ? 1 0 ? ? ? ? ? set the p86 pin as tx2 (open-drain output) and the p85 pin as rx2. p8fr1 ? 1 1 ? ? ? ? ? p8odcr ? 1 ? ? ? ? ? ? imr53 ? ? 1 1 0 1 1 0 enable inttx2 and intrx2. imr52 ? ? 1 10 101 sc2mod0 0 0 1 1 1 1 1 0 select 9-bit uart mode, select imclk as a serial clock and set the wu bit to 1. interrupt routine (intrx2) iclr 0 1 1 0 1 0 1 0 0 clear the interrupt request. reg. sc2cr and 0x1c if reg. 0 then error reg. sc2buf check for errors. if reg. = select code then sc2mod0 ? ? ? 0 ? ? ? ? clear the wu bit to 0. tmp19a71  12-45
tmp19a71 13. analog-to-digital converters (adcs) the tmp19a71 contains two 10-bit successive-approximation analog-to-digital converters (adcs). both adcs have two modes; normal mo de and pmd mode. while normal mode supports typical ad conversion with two 8-channel inputs, pmd mode is specifically designed for ad conversion for motor control. in pmd mode, the adcs have 8-channel and 11-channel inputs. the two adcs can be programmed to operate independently, and the operating mode can be separately selected for each of the adcs. 13.1 features 13.1.1 normal mode 1 two 8-channel, 10-bit ad conver ters are available. each chan nel has a separate conversion result register. 2 the two ad converters can be independentl y programmed for fixed-channel or channel scan mode. 3 the two ad converters can be independently programmed for single conversion or continuous conversion mode. 4 the intad0/1 interrupt is generated upon completion of a conversion. the interrupt interval is selectable. 5 setting register enables starting of an ad conversion under the following conditions: ? tmrb inte rrupt (inttb1) ? ext ernal trigger input (adtrg0/1) ? soft ware trigger (adsft0) 6 the highest-priority conversion can interrupt the ongoing conversion in channel scan and fixed-channel continuous conversion modes (the highest-priority conversion can only initiated by software). 7 the intadhp0/1 interrupt is generated upon completion of the highest-priority conversion. 8 ad conversions can be monitored vi a the busy and overrun flags. 9 in channel scan continuous conversion mode, the interval between conversions can be selected. 10 the conversion result can be compared to the two compare registers. the user can select whether or not to generate an interrupt when the conversion result equals the compare register. 13.1.2 pmd mode 1 two 10-bit ad converters are available. one has 8 conversion result registers, and the other has 11 conversion re sult registers. 2 the conversion enable, input channel and pmd timing trigger can be programmed independently for each conversion result register. 3 conversions are started in ascending order from the smallest-numbered enabled conversion result register. 4 the conversion interval can be increased by a maximum of 255 times the pmd trigger interval. tmp19a71 13-1
tmp19a71 13.2 register description each of the two adcs contains a group of regi sters for both normal mode and pmd mode as shown in table 13.2.1 . table 13.2.1 adc register map (1/3) normal mode (adc0) address bits mnemonic register name 0xffffc900 16 adnres0 ad normal mode result register 0 0xffffc904 16 adnres1 ad normal mode result register 1 0xffffc908 16 adnres2 ad normal mode result register 2 0xffffc90c 16 adnres3 ad normal mode result register 3 0xffffc910 16 adnres4 ad normal mode result register 4 0xffffc914 16 adnres5 ad normal mode result register 5 0xffffc918 16 adnres6 ad normal mode result register 6 0xffffc91c 16 adnres7 ad normal mode result register 7 0xffffc920 16 adchpr0 highest-priority conversion result register (adc 0) 0xffffc924 16(8) adnmod0 (l) ad normal mode control register (low) (adc0) 0xffffc925 8 adnmod0h ad normal mode control register high (adc0) 0xffffc928 8 adnclk0 ad normal mode clock control register (adc0) 0xffffc92c 16(8) cmpctl0 (l) ad monitor control register (low) (adc0) 0xffffc92c 8 cmpctl0h ad monitor control register high (adc0) 0xffffc930 8 adchpc0 highest-priority conversion cont rol register (adc0) 0xffffc934 16 adcmp00 ad compare register 0(adc0) 0xffffc938 16 adcmp01 ad compare register 1 (adc0) 0xffffc93c 16 adcbasn0 ad normal mode basic setting register (adc0) 0xffffc940 8 adcstart0 ad software start register (adc0) tmp19a71 13-2
tmp19a71 table 13.2.2 adc register map (2/3) normal mode (adc1) address bits mnemonic register name 0xffffc980 16 adnres8 ad normal mode result register 8 0xffffc984 16 adnres9 ad normal mode result register 9 0xffffc988 16 adnres10 ad normal mode result register 10 0xffffc98c 16 adnres11 ad normal mode result register 11 0xffffc990 16 adnres12 ad normal mode result register 12 0xffffc994 16 adnres13 ad normal mode result register 13 0xffffc998 16 adnres14 ad normal mode result register 14 0xffffc99c 16 adnres15 ad normal mode result register 15 0xffffc9a0 16 adchpr1 highest-priority conversion result register (adc 1) 0xffffc9a4 16(8) adnmod1 (l) ad normal mode control register (low) (adc1) 0xffffc9a5 8 adnmod1h ad normal mode control register high (adc1) 0xffffc9a8 8 adnclk1 ad normal mode clock control register (adc1) 0xffffc9ac 16(8) cmpctl1 (l) ad monitor control register (low) (adc1) 0xffffc9ac 8 cmpctl1h ad monitor control register high (adc1) 0xffffc9b0 8 adchpc1 highest-priority conversion cont rol register (adc1) 0xffffc9b4 16 adcmp10 ad compare register 0(adc1) 0xffffc9b8 16 adcmp11 ad compare register 1 (adc1) 0xffffc9bc 16 adcbasn1 a/d normal mode basic setting register (adc1) 0xffffc9c0 8 adcstart1 ad software start register (adc1) pmd mode (adc0) address bits mnemonic register name 0xffffcd00 16 adpres0 ad pmd mode result register 0 0xffffcd04 16 adpres1 ad pmd mode result register 1 0xffffcd08 16 adpres2 ad pmd mode result register 2 0xffffcd0c 16 adpres3 ad pmd mode result register 3 0xffffcd10 16 adpres4 ad pmd mode result register 4 0xffffcd14 16 adpres5 ad pmd mode result register 5 0xffffcd18 16 adpres6 ad pmd mode result register 6 0xffffcd1c 16 adpres7 ad pmd mode result register 7 0xffffcd40 16(8) adcsett00 (l) ad input timing trigger register 0 (low) (adc0) 0xffffcd41 8 adcsett00h ad input timing trigger register 0 high (adc0) 0xffffcd48 16(8) adcset00 (l) ad input port select register 0 (low) (adc0) 0xffffcd49 8 adcset00h ad input port select register 0 high (adc0) 0xffffcd4c 16(8) adcset01 (l) ad input port select register 1 (low) (adc0) 0xffffcd4d 8 adcset01h ad input port select register 1 high (adc0) 0cffffcd58 8 adpclk0 ad pmd mode clock control register (adc0) 0xffffcd5c 8 adpmod00 ad pmd mode control register 0 (adc0) 0xffffcd60 16(8) adpmod01 (l) ad pmd mode control register 1 (low) (adc0) 0xffffcd61 8 adpmod01h ad pmd mode control register 1 high (adc0) 0xffffcd64 16(8) adcne0 (l) a/d count enable register (low) (adc0) 0xffffcd65 8 adcne0h a/d count enable register high (adc0) 0xffffcd68 8 adcnt0 a/d conversion count setting register (adc0) 0xffffcd6c 16 adcbasp0 a/dpmd mode basic setting register (adc0) 0xffffcd70 8 admodsel0 ad mode control register (adc0) tmp19a71 13-3
tmp19a71 table 13.2.3 adc register map(3/3) pmd mode (adc1) address bits mnemonic register name 0xffffcd80 16 adpres8 ad pmd mode result register 8 0xffffcd84 16 adpres9 ad pmd mode result register 9 0xffffcd88 16 adpres10 ad pmd mode result register 10 0xffffcd8c 16 adpres11 ad pmd mode result register 11 0xffffcd90 16 adpres12 ad pmd mode result register 12 0xffffcd94 16 adpres13 ad pmd mode result register 13 0xffffcd98 16 adpres14 ad pmd mode result register 14 0xffffcd9c 16 adpres15 ad pmd mode result register 15 0xffffcda0 16 adpres16 ad pmd mode result register 16 0xffffcda4 16 adpres17 ad pmd mode result register 17 0xffffcda8 16 adpres18 ad pmd mode result register 18 0xffffcdc0 16(8) adcsett10 (l) ad input timing trigger register 0 (low) (adc1) 0xffffcdc1 8 adcsett10h ad input timing trigger register 0 high (adc1) 0xffffcdc4 8 adcsett11 ad input timing trigger register 1 (adc1) 0xffffcdc8 16(8) adcset10 (l) ad input port select register 0 (low) (adc1) 0xffffcdc9 8 adcset10h ad input port select register 0 high (adc1) 0xffffcdcc 16(8) adcset11 (l) ad input port select register 1 (low) (adc1) 0xffffcdcd 8 adcset11h ad input port select register 1 high (adc1) 0xffffcdd0 16(8) adcset12 (l) ad input port select register 2 (low) (adc1) 0xffffcdd1 8 adcset12h ad input port select register 2 high (adc1) 0xffffcdd8 8 adpclk1 ad pmd mode clock control register (adc1) 0xffffcddc 8 adpmod10 ad pmd mode control register 0 (adc1) 0xffffcde0 16(8) adpmod11 (l) ad pmd mode control register 1 (low) (adc1) 0xffffcde1 8 adpmod11h ad pmd mode control register 1 high (adc1) 0xffffcde4 16(8) adcne1 (l) a/d counting co nversion enable register (low) (adc1) 0xffffcde5 8 adcne1h a/d counting co nversion enable register high (a dc1) 0xffffcde8 8 adcnt1 a/d conversion count setting register (adc1) 0xffffcdec 16 adcbasp1 a/dpmd mode basic setting register (adc1) 0xffffcdf0 8 admodsel1 ad mode control register (adc1) note 1: some of 16-bit adc registers is accessible in 8-bit system by dividing higher 8bits and lower 8 bits. i.e. adnmod0 becomes accessible in 8-bit system by making it be adnmod0l/adnmod0h. tmp19a71 13-4
tmp19a71 the modsel bit in the admodsel0 register is used to select either normal mode (modsel = 0) or pmd mode (modsel = 1). normal mode provides the ad monitor and highest-priority conversion features. pmd mode is synchronous to the trigger inputs from a programmable motor driver (pmd). in normal mode, the two adcs are basically functionally equivalent; in the following description any references to adc0 also apply to adc1. ad mode control register (adc0) 7 6 5 4 3 2 1 0 bit symbol D D D D D D vrefon modsel read/write r/w reset value 0 0 0 0 0 0 0 0 function vref control 0: off 1: on adc conversion mode 0: normal mode 1: pmd mode a dmodsel0 (0xffff_cd70) note 1: the mdosel bit must not be changed during an ad conversion. if it is changed, operation cannot be guaranteed. note 2: registers other than those for the selected conversion mode must not be programmed. before programming registers, the m odsel bit must be programmed to select normal or pmd mode. note 3: the vrefon bit must be set 3 us before an ad conversion is started to ensure the stable internal reference voltage. if an ad conversion is started with vrefon= 0 or before the internal reference voltage has stabilized, conversion accuracy cannot be guaranteed. note 4: the vrefon bit is automatically set to 1 after an ad conversion is started. however, conversion accuracy cannot be guara nteed until the reference voltage has stabilized (see note 3). tmp19a71 13-5
tmp19a71 13.3 normal mode (admodsel0.modsel=0) ad normal mode control register (low) (adc0) 7 6 3 4 3 2 1 0 bit symbol D adch lat itm rep scan read/write r/w reset value 0 0 0 0 0 0 0 0 function must be set to 0. analog input channel select latency 0: none 1: wait until the resul t register is read. interrupt in fi xed- channel continuous conv ersion mode continuous conv ersion mode 0: single 1: continu- ous channel sca n mode 0:fixed- channel 1: channel scan a dnmod0(l) (0xffff_c924) analog input channel select scan adch0 [2:0] 0 fixed-channel mode 1 channel scan mode 000 ain0 ain0 001 ain1 ain0 to ain1 010 ain2 ain0 to ain2 011 ain3 ain0 to ain3 100 ain4 ain0 to ain4 101 ain5 ain0 to ain5 110 ain6 ain0 to ain6 111 ain7 ain0 to ain7 interrupt in fixed-channel continuous conversion mode fixed-channel continuous conversion mode scan = 0, rep = 1 0 generate an interrupt when a single conversion has been completed. 1 generate an interrupt when a sequence of four conversions has been completed. ain7 ain15 ain5 ain13 ain6 ain14 ain4 ain12 ain2 ain10 ain3 ain11 ain1 ain9 ain0 ain8 in adc1, the input channels correspond as fol lows: note 1: ain7 pin (ain15 pin for adc1) may be used as adtrg0 input pin. therefore, when adtrg0 is used in adnmod0= ?10?, do not set to adnmod0=?111,? and when adtrg1 is used in adnmod1=?11,? do not set to adnmod1=?111.? note 2: adnmod0 setting becomes effective only when it is in continuous conversion mode. when adnmod 0=?1? is set, the next conversion does not start until th e reading of the register stored at the end is finished. for example, when adnmod0=?101,? adnmod0=?1,? adnmod0=?1,? and a dnmod0=?1,? the next conversion does not start until reading of the result for adnres5 after channel scan conversion has finished. when adnres5 is read prior to adnres0 ? 4, the next conversion starts as adnres5 starts to be read. and, when adnmod0=?101,? adnmod0=?1,? adnmod0=?1,? adnmod0=?1,? and adnmod0=?0,? the next conversion does not start unt il the results are stored four times in adnres5 and are read out. tmp19a71  13-6
tmp19a71 ad normal mode control register (high) (adc0) 15 14 13 12 11 10 9 8 bit symbol D D D D D trge tsel read/write r r/w reset value 0 0 0 0 0 0 0 0 function must be set to 0. must be set to 0. normal mode conversion trigger 0: software 1: hardware hardware trigger source 00: reserved 01: inttbcom11 10: adtrg0 11: adtrg1 note 1: when =?1? is set, too, it can be started up by software. note 2: adc1 also can select inttbcom11 as a hardware starting source by setting adnmod1=01. ad software start register (adc0) 7 6 5 4 3 2 1 0 bit symbol busy eos D D D D D adsft read/write r r/w r w reset value 0 0 0 0 0 0 0 0 function normal mode ad conversion busy flag 0: idle 1: busy conversion co mplete flag 0: don?t ca re 1:complet- ed write a 0 to cle ar this bit. a d co nversion start 0: don?t car e 1: st art this bit is alw ays read as 0. note: the busy bit indicates whether or not an ad conversion is in progress. use the eos bit to check whether or not an ad conversion has completed. a/d normal mode basic setting register (adc0) 7 6 5 4 3 2 1 0 bit symbol D D D D D azsel D D read/write r/w reset value 0 0 0 0 0 0 0 0 function must be set to 0. must be set to 0. must be set to 0. must be set to 0. must be set to 0. sample hold time 1: 6 clocks 0: 12 clocks must be set to 0. must be set to 0. 15 14 13 12 11 10 9 8 bit symbol D D D D D D D D read/write r/w reset value 0 0 0 1 0 0 0 0 function must be set to 0. must be set to 0. must be set to 0. must be set to 1. must be set to 0. must be set to 0. must be set to 0. must be set to 0. a dcstart0 (0xffff_c940) (adnmod0h) (0xffff_c925) adcbasn0 (0xffff_c93c) note: the time taken for the conversion of adc is derived from the equation, (the number of clocks selected in 27 clocks)/adclk. tmp19a71 13-7
tmp19a71 highest-priority conversion control register (adc0) 7 6 5 4 3 2 1 0 bit symbol D D D hbsy hprq hpch read/write r r/w reset value 0 0 0 0 0 0 0 0 function highest- priority ad co nversion busy flag 0: co mpleted 1: busy highest- priority co nversion request 0: don?t car e 1: start h ighest- priority conversion highest-priority channel select a dchpc0 (0xffff_c930) highest-priority analog input channel select scan adch [2:0] 0 fixed-channel mode 000 ain0 001 ain1 010 ain2 011 ain3 100 ain4 101 ain5 110 ain6 111 ain7 ain7 ain15 ain6 ain14 ain5 ain13 ain4 ain12 ain3 ain11 ain2 ain10 ain1 ain9 ain0 ain8 in adc1, the input channels correspond as fol lows: note: ain7 pin (ain15 pin for adc1) may be used as adtrg0 input pin. therefore, when adtrg0 is used in adnmod0= ?10,? do not set to adnmod0=?111,? and when adtrg1 is used in adnmod1=?11,? do not set to adnmod1=?111.? tmp19a71 13-8
tmp19a71 there are 16 conversion result registers numbered from 0 to 15, which are all identical. the following is a description of register 0. ad normal mode conversion result register 0 7 6 5 4 3 2 1 0 bit symbol adr read/write r reset value 0 0 0 0 0 0 0 0 function lower 8 bits of an ad conversion result 15 14 13 12 11 10 9 8 bit symbol val ovr D D D D adr read/write r reset value 0 0 0 0 0 0 0 0 function conversio n result store flag 1: stored overrun flag 0: no overrun 1: overrun upper 2 bits of an ad conversion result a dnres0 (0xffff_c91c) note 1: this register must be accessed as a 16-bit or larger quantity. if it is accessed as an 8-bit quantity, operation cannot be guaranteed. note 2: bit 15 is an ad conversion result flag adnres0. 1 is set to this when ad conversion value is stored, and it is cleared t o 0 when the adnres0 is read. note 3: bit 14 is an overrun flag adnres0. 1 is set to this when it is overwritten before reading the conversion result register adnres0. this bit is cleared to 0 when a new conversion result is stored in adnres0 with val=0. note 4: this register does not support bit manipulation instructions. highest-priority conversion result register (adc0) 7 6 5 4 3 2 1 0 bit symbol adr read/write r reset value 0 0 0 0 0 0 0 0 function lower 8 bits of an ad conversion result 15 14 13 12 11 10 9 8 bit symbol val ovr D D D D adr read/write r reset value 0 0 0 0 0 0 0 0 function conversion r esult store flag 1: stored overrun flag 0: no overrun 1: overrun upper 2 bits of an ad conversion result a dchpr0 (0xffff_c9020) note 1: this register must be accessed as a 16-bit or larger quantity. if it is accessed as an 8-bit quantity, operation cannot be guaranteed. note 2: bit 15 is an ad conversion result flag adnres0. 1 is set to this when ad conversion value is stored, and it is cleared t o 0 when the adnres0 is read. note 3: bit 14 is an overrun flag adnres0. 1 is set to this when it is overwritten before reading the conversion result register adnres0. this bit is cleared to 0 when a new conversion result is stored in adnres0 with val=0. note 4: this register does not support bit manipulation instructions. tmp19a71 13-9
tmp19a71 ad normal mode clock control register 1 7 6 5 4 3 2 1 0 bit symbol D D D D D adcck read/write r r/w reset value 0 0 0 0 0 0 0 0 function prescaler clock o utput select 001: imclk/2 010: imclk/4 011: imclk/8 100: imclk/16 other: imclk a dnclk0 (0xffff_c928) note 1: ad conversion is performed at the clock frequency selected in this register. to assure conversion accuracy, however, the conversion clock frequency must be 14 mhz or slower (which results in a conversion time of 2.36 s or longer with 6-clock sample hold). note 2: the conversion clock must not be changed while ad conversion is in progress. wait at least 2 adclk clocks after ad con version has completed before changing the conversion clock. 2 imclk adcck adclk0 4 8 16 ( ad conversion clock ) figure 13.3.1 clo ck control circuit tmp19a71  13-10
tmp19a71 a/d monitor control register (adc0) 7 6 5 4 3 2 1 0 bt symbol D D cmch0 cmop0 irqen0 cmcap0 read/write r r/w reset value 0 0 0 0 0 0 0 0 function ad input channel 0 to be compared a/d monitor interrupt setting is 0. 0:under compare register 1: more than compare register a/d monitor inte rrupt setting is 0. 0: disable 1: enable a/d monitor inte rrupt flag is 0. 0:monitoring non-gene- rated interru pt 1:monitoring genera ted interrupt cmpctl0(l) (0xffff_c92c) cnch ad input channel t o be compared 000 ain0 001 ain1 010 ain2 011 ain3 100 ain4 101 ain5 110 ain6 111 ain7 ad monitor control register (adc0) 15 14 13 12 11 10 9 8 bit symbol D D cmch1 cmop1 irqen1 cmcap1 read/write r r/w reset value 0 0 0 0 0 0 0 0 function ad input channel 1 to be compared a/d monitor interrupt setting is 1. 0:under compare register 1: more than compare register a/d monitor interrupt setting is 1. 0: disable 1: enable a/d monitor interrupt flag is 1. 0:monitoring non-gene- rated interru pt 1:monitoring genera ted interrupt cnch ad input channel t o be compared 000 ain0 001 ain1 010 ain2 011 ain3 100 ain4 101 ain5 110 ain6 111 ain7 ain7 ain15 in adc1, the input channels correspond as follows: ain0 ain8 ain1 ain9 ain7 ain15 ain6 ain14 ain5 ain13 ain4 ain12 ain3 ain11 ain2 ain10 ain6 ain14 ain5 ain13 ain4 ain12 ain3 ain11 ain2 ain10 ain1 ain9 ain0 ain8 in adc1, the input channels correspond as fol lows: (cmpctl0h) (0xffff_c92d) tmp19a71 13-11
tmp19a71 note: cmcapx is cleared to 0 by writing data in ?1? or in adcmpxx. because interrupt requests are continuously sent until this register is cleared, it must be cleared within the monitor interrupt routine. tmp19a71 13-12
tmp19a71 a/d conversion result compare register (adc0) 7 6 5 4 3 2 1 0 bit symbol adr0 read/write r/w reset value 0 0 0 0 0 0 0 0 function a/d conversion result compare value 0 is stored. 15 14 13 12 11 10 9 8 bit symbol D D D D D D adr0 read/write r reset value 0 0 0 0 0 0 0 0 function a dcmp00 (0xffff_c934) a/d conversion result compare register (adc0) 7 6 5 4 3 2 1 0 bit symbol adr1 read/write r/w reset value 0 0 0 0 0 0 0 0 function a/d conversion result compare value 1 is stored. 15 14 13 12 11 10 9 8 bit symbol D D D D D D adr1 read/write r reset value 0 0 0 0 0 0 0 0 function a dcmp01 (0xffff_c938) tmp19a71 13-13
tmp19a71 13.4.1 operation (normal mode) 13.4.1.1 analog reference voltage clearing the vrefon bit in the admodsel0 turns off the switch between the vrefh and frefl pins. once the vrefon bit is cleared, the internal reference voltage requires a recovery time of 3 s to stabilize after the vrefon bit is again set to 1. before starting an ad conversion, therefore, be sure to wait for 3 s after setting the vrefon bit to 1. if an ad conversion is started before this stabilization period has elapsed, conversion accuracy cannot be guaranteed. 13.4.1.2 selecting an analog input channel(s) selection of the analog input channel(s) to be used varies according to the operating mode of the ad converter. (1) normal ad conversion when an analog input is used in channel fixed mode (adnmod0 = ?0?) among the analog input from ain0 to ain 7, select one channel according to the adn mod0 setting. ? ? when an analog input is used in channel scan mode (adnmod0 = ?1?) select one scan mode among the eight types scan modes according to the adn mod0 setting. (2) highest priority ad conversion am ong the analog input from ain0 to ain 7, select one channel according to the a/dchpc0 setting. after resetting, adnmod0 is initialized to 0, and adnmod0to 0000, wh ich makes the selection be in proc essing, and channel fixed mode input of ain0 pin is selected. note that pins not used as analog input channels can be used as normal ports (a part of them are for input only), however, the conversion accuracy may get worse. when the highest-priority ad conversi on is started during the normal ad conv ersion, the highest-priority one starts in a break, the normal ad conversion resumes at the end of the highest-priority one is over. example: when the highest-priority conversion of ain7 is started in adchp0=111 durin g the continuous scan conversion of the channel from ain0 to ain3 in adnmod0=11 and adnmod0=00011. highest-priority ad conversion startup (software startup) ch0 ch1 ch2 ch7 ch3 ch0 ch1 conversion ch tmp19a71 13-14
tmp19a71 13.3.1.1 starting of ad conversion ad conversion has two types; normal ad conversion and highest-priority ad conversion. a normal ad conversion starts up in software by setting 1 to adcstart0. also, the highest-priority conversion starts up in software by setting 1 to adchpc0. a for normal ad conversion, one operating mode among the four operating modes specified by adnmod0. an operating mode of the highest-priority conversion is channel-fixed single conversion only. a normal ad conversion can start up with hardware starting source sele cted by adnmod0 by setting 1 to adnmod0. when this bit is ?10/11,? a normal ad conversion star ts up at the rising edge of adtrg0 pin, and when ?01,? it starts up with inttbcom11 of the timer from 16-bit quantity. it can start in software even if the startup in hardware beco mes enabled. when a normal ad conversion starts, 1 is set to an ad conversion busy flag ( adcstart0) indicating that the conversion is in progress. when the highest-priority ad conversion starts, 1 is set to an ad conversion busy flag (adchpc0). at this time, a busy flag for normal ad conversion retains the value before a starting of the highest-priority ad conversion. a conversion end flag adcstart0 for normal ad conversion, also, retains the value before a starting of the highest-priority ad conversion. since adcstart0 is a flag showing the conversion operation, it has an interval of being 0 between the conversions such as those in the continuous conversion mode. when palling the end of conversion, adcstart0 must not be used. when 1 is set to adchpc0 during a normal ad conversion, the high est-priority ad conversion starts upon th e storage of result register of the ongoing conversion, and ad conversion (channel-fixed single conversion) of the cannel specified by adchpc0 starts. when this result is stored in the result register adchpr0, a normal ad conversion resumes operation from the part suspended. 13.3.1.2 restart a normal ad conversion restarts when 1 is set to adcstart0 during the channel-fixed normal conversion, or it is started with hardware source. at the time of restarting, a normal ad conversion performed till then starts conversion after a lapse of conversion time, however, the result that has been converted at the moment of restarting is not stored. restarting does clear neither the flags of nor . note 1: when continuous conversion is in process, stop it first (adnmod0=0) and restart after all of the conversions ended. note 2: when channel scan mode conversion is in process, restart after all of the conversions ended. 13.3.1.3 stop repeat changing the adnmod0 bit in from 1 to 0 enables the stop of repeating after the continuous conversion made one-cycle repeat. in channel-fixed continuous conversion mode (interrupts after four conversions), as an interrupt generates after conversion is performed four times, the continuous conver sion stops. in channel scan continuous conversion mode, after the conversions performed as much as specified number of channels, the continuous conversion stops as an interrupt is generated. tmp19a71 13-15
tmp19a71 13.3.1.4 ad conversion mode and interrupt in the end of ad conversion the normal mode has the four operating modes shown in table 13.3.1. normal ad conversion can select a mode according to the adnmod0 setting while the highest-priority ad conversion can select on ly channel-fixed single conversion regardless of the adnmod0 setting. table 13.3.1 rel ations of ad conversion mode, interrupt generation timing, and flag behavior adnmod0 conversion mode interrupt gene ration timing eos set timing (note 1) busy (after an interrupt has generated ) itm rep scan fixed-channel single conversion after a conversion ends after a conversion ends 0 0 0 channel scan single conversion after a scan conversion ends after a scan conversion ends 0 0 1 every time of conversion after a conversion ends. 1 0 fixed-channel continuous conversion every fur times of conversion after a conversion ends four times 1 1 1 0 channel scan continuous conversion every time of scan conversion after a scan conversion ends. 1 1 1 note 1: write 0 and clear eos. (1) normal ad conversion adnmod0 selects an operating mode. as an ad conversion starts, 1 is set t o adcstart0. after a specified ad conversion ends, 1 is set to adcstart0 that indicates the ad conversion ended, and then an ad conversion end interrupt (intad0) generates. is cleared to 0 as is set when =?0.? there are timings to be 0 at the intervals of each channel conversion when =?1.? a) fixed-channel single conversion mode this mode is selected by programming the rep and scan bits in the adnmod0 reg ister to 00. in this mode, the adc performs a single conversion on a single selected channel. when a conversion is completed, the adc sets 1 to the adcstart0.eos bit, clears the adcstart0.busy bit in 0 and generates the intad0 interrupt. the eos bit must be cleared by writing 0. b) channel scan single conversion mode this mode is selected by programming the rep and scan bits in the adnmod0 reg ister to 01. in this mode, the adc performs a single conversion on each selected group of channels. when a single conversion sequence is completed, the adc sets 1 to the adcstart0.eos bit, clears the adcstart0.busy bit in 0 and generates the intad0 interrupt. the eos bit must be cleared by writing 0. tmp19a71 13-16
tmp19a71 c) fixed-channel continuous conversion mode this mode is selected by programming the rep and scan bits in the adnmod0 register to 10. in this mode, the adc repeatedly converts a single selected channel. when a conversion process is completed, the adc sets 1 to the adcstart0.eos bit. a generation timing of an interrupt re quest is selectable according to the adnmod0 setting. the setting timing of eos is associated with the timing of an interrupt. the eos bit must be cleared by writing 0. when itm=0, the adc generates an interrupt request every time a conversion ends. in this case, the conversion result is stored in the corresponding conversion result register to a selected channel, whic h makes 1 be set to the eos bit. when itm=1, the adc generates an in t errupt after every four conversions completed. the conversion result is stored in the corresponding conversion result register to a selected channel. after the result of the fourth conversion is stored, 1 is set to the eos bit. and then, a conversion starts again. the eos bit must be cleared by writing 0. adnmod0 setting can make the next conversion of the conversion in contin uous conversion mode wait until the result register is read. when itm=0, the time taken until a conver sion starts after a previous conversion ends is controlled, and when itm=1, the ti me taken until a conversion starts after previous conversion ends four times is controlled. d) channel scan continuous conversion mode this mode is selected by programming the rep and scan bits in the adnmod0 reg ister to 11. in this mode, the adc repeatedly converts the selected group of channels. every time a scan conversion ends, 1 is set to adnmod0, and an interrupt request of intad0 generates. adnmod0 has a timing that becomes 0 at the interval of each channel conversion. the eos bit must be cleared by writing 0. to stop the operation of conversion of continuous conversion modes, described in c) and d ), 0 shall be written to adnmod0. the mode ends as an ongoing conversion ends, and adnmod0 is cleared to 0. stop ad conversions and set 0 to admodsel0 before transferring to a stop m ode. the electricity is carried even it is in the stop mode unless the transfer is made stopping a conversion. if the transfer is made with an ad conversion in performing, the result come out after the releasing of the stop mode is not guaranteed. (2) the highest-priority ad conversion adnmod0 setting has no effect on the highest-priority ad conv ersion. its operation mode is channel-fixed single conversion mode only. when the starting condition is met, the highest-priority ad conversion of a specified channel in adchpc0 is performed only one time. as the conversion ends, an interrupt of the highest-priority ad conversion end generates, and adchpc0 is cleared to 0. tmp19a71 13-17
tmp19a71 13.3.1.5 highest-priority conversion mode the highest-priority ad conversion can interr upt a normal ad conversion. the highest-priority ad conversion can start by setting 1 to adchpc0. if the highest-priority ad conversion starts during the normal ad conversion, ad conversion result during the conversion process is stored in a result register, and after that, a channel specified by adchpc0is single-converted. that result is stored in adchpr0, and the highest-priority ad conversion interrupt generates. then, the normal ad conversion resumes from the part continued from the previous time. if the highest-priority ad conversion restarts during the highest-priority ad conversion process, the conversion in process is finished, and then the highest-priority conversion starts newly. for example, if the continuous conversion of the channels from ain0 to ain7 is active, and 1 is set to while ain3 is converted, the channel specified by is converted as soon as the ain3 conversion ends , and the result is stored in adchpr0, and then the continuous conversion restarts from ain4. 13.3.1.6 ad monitoring each ad converter has two ad monitoring functions and can compare a conversion value and tw o setting value simultaneously. when 1 is set to cmpctl0, an ad monitoring is enabled. when the contents of a conversion result register specified by cmpctl0 is more than or under the value of compare register (it is specified by ), ad monitoring interrupt (intadm0) generates. cmpctl0 can determine which setting condition is met. also, this comparing operates every time a result is stored in the relevant conversion result register, and as the condition is met, an interrupt generates. note that since a regi ster assigned to ad monitoring is not read in software in general, the overrun flag adnres0 and the conversion result flag adnres0 are always set. therefore, to use the ad monitoring, do not use the flag of a relevant conversion result register. 13.3.1.7 ad conversion time one ad conversion takes 27 clocks excluding sampling clocks. in adcbasn0,6 or 12 c locks can be selected as sampling clocks, thus the sum of ad conversion clocks may be 33 or 39. adnclk0 selects an ad conversion clocks among the ad pre-scaler output; imclk, imclk/2, imclk/ 4, imclk/8, and imclk/16.to assure the accuracy, it is necessary to set the ad conversion clock less than 14mhz, i.e. under 2.36 s (if sample hold is 6 clocks). 13.3.1.8 storage and read of ad conversio n result ad conversion results are stored in th e result register of a normal ad conversion (from adnres0 to adnres7). correspondence of result registers and analog input channels are the same in any operating mode if they are in normal mode. for example, the result of ain0 conversion is always stored in the adnres0 register. table 13.3.2 shows the correspondence of analog input channels and ad conversion result registers. tmp19a71 13-18
tmp19a71 table 13.3.2 analog input channel and ad conversion register analog input channel conversion result register ain0 adnres0 ain1 adnres1 ain2 adnres2 ain3 adnres3 ain4 adnres4 ain5 adnres5 ain6 adnres6 ain7 adnres7 13.3.1.9 data polling to process an ad conversion result by polling data without using any interrupt, a dnmod0 is to be polled. when this flag is set, a conversion result is stored in a predetermined ad conversion result register. therefore ad conversion result register must be read after checking the set. to detect an overrun at the time, the conversion result register must be read in 16-bit system. if the result were =0 and =1, a conversion result not overwritten would be gained. tmp19a71 13-19
tmp19a71 13.4.1 pmd mode (modsel=1) in pmd mode, the adc performs ad conversions synchronous to a pmd trigger. the pmd trigger can be selected from three types: pmdtrg00 to pmdtrg02. the adc0 has 8 conversion result registers while the adc1 has 11 conversion result registers. for each of these result registers, an analog input port and a pmd trigger can be programmed separately, and ad conversions ca n be enabled and disabled separately for each register. also, each of adc unit has a counter, and the two cycles; every time and the specified num ber can be set to the counter. as all the programs enabled are converted completely, an adc interrupt generates. ad input timing trigger register (adc0) 7 6 5 4 3 2 1 0 bit symbol adst3 adst2 adst1 adst0 read/write r/w reset value 0 0 0 0 0 0 0 0 function input timing trigger for result register 3 00: pmdtrg00 01: pmdtrg01 10: pmdtrg02 11: reserved input timing trigger for result register 2 00: pmdtrg00 01: pmdtrg01 10: pmdtrg02 11: reserved input timing trigger for result register 1 00: pmdtrg00 01: pmdtrg01 10: pmdtrg02 11: reserved input timing trigger for result register 0 00: pmdtrg00 01: pmdtrg01 10: pmdtrg02 11: reserved 15 14 13 12 11 10 9 8 bit symbol adst7 adst6 adst5 adst4 read/write r/w reset value 0 0 0 0 0 0 0 0 function a dcsettoo(l) (0xffff_cd40) (adcsettooh) (0xffff_cd41) input timing trigger for result register 4 00: pmdtrg00 01: pmdtrg01 10: pmdtrg02 input timing trigger for result register 5 00: pmdtrg00 01: pmdtrg01 10: pmdtrg02 input timing trigger for result register 7 00: pmdtrg00 01: pmdtrg01 10: pmdtrg02 11: reserved input timing trigger for result register 6 00: pmdtrg00 01: pmdtrg01 10: pmdtrg02 11: reserved 11: reserved 11: reserved tmp19a71 13-20
tmp19a71 ad input timing trigger register 0 (adc1) 7 6 5 4 3 2 1 0 bit symbol adst11 adst10 adst9 adst8 read/write r/w reset value 0 0 0 0 0 0 0 0 function ad input timing trigger register 1(adc1) 7 6 5 4 3 2 1 0 bit symbol D D adst18 adst17 adst16 read/write r/w reset value 0 0 0 0 0 0 0 0 function input timing trigger for result register 10 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 11: reserved input timing trigger for result register 9 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 11: reserved input timing trigger for result register 8 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 11: reserved input timing trigger for result register 11 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 11: reserved input timing trigger for result register 10 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 11: reserved input timing triffer for result register 9 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 11: reserved input timing triffer for result register 8 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 11: reserved 15 14 13 12 11 10 9 8 bit symbol adst15 adst14 adst13 adst12 read/write r/w reset value 0 0 0 0 0 0 0 0 function a dcsett1o(l) (0xffff_cdc0) (adcsett1oh) (0xffff_cdc1) input timing triggr for result register 12 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 input timing trigger for result register 14 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 11: reserved input timing trigger for result register 13 input timing trigger for result register 15 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 00: pmdtrg10 01: pmdtrg11 10: pmdtrg12 11: reserved 11: reserved 11: reserved a dcsett11 (0xffff_cdc4) tmp19a71 13-21
tmp19a71 ad input port select register 0 (adc0) 7 6 5 4 3 2 1 0 bit symbol D adsi1 D adsi0 read/write r/w reset value 0 0 0 0 0 0 0 0 function must be written as 0. ad input port select register 1 (adc0) input port for result register 1 000: ain0 001: ain1 010: ain2 011: ain3 100: ain4 101: ain5 110: ain6 111: ain7 must be written as 0. input port for result register 0 000: ain0 001: ain1 010: ain2 011: ain3 100: ain4 101: ain5 110: ain6 111: ain7 15 14 13 12 11 10 9 8 bit symbol D adsi3 D adsi2 read/write r/w reset value 0 0 0 0 0 0 0 0 function must be written as 0. input port for result register 3 000: ain0 001: ain1 010: ain2 011: ain3 100: ain4 101: ain5 110: ain6 111: ain7 must be written as 0. input port for result register 2 000: ain0 001: ain1 010: ain2 011: ain3 100: ain4 101: ain5 110: ain6 111: ain7 7 6 5 4 3 2 1 0 bit symbol D adsi5 D adsi4 read/write r/w reset value 0 0 0 0 0 0 0 0 function must be written as 0. input port for result register 5. 000: ain0 001: ain1 010: ain2 011: ain3 100: ain4 101: ain5 110: ain6 111: ain7 must be written as 0. input port for result register 4 000: ain0 001: ain1 010: ain2 011: ain3 100: ain4 101: ain5 110: ain6 111: ain7 15 14 13 12 11 10 9 8 bit symbol D adsi7 D adsi6 read/write r/w reset value 0 0 0 0 0 0 0 0 function a dcset0o(l) (0xffff_cd48) (adcset0oh) (0xffff_cd49) a dcset01(l) (0xffff_cd4c) (adcset01h) (0xffff_cd4d) input port for result register 6 000: ain0 001: ain1 010: ain2 011: ain3 100: ain4 101: ain5 110: ain6 must be written as input port for result register 7 000: ain0 001: ain1 010: ain2 011: ain3 100: ain4 101: ain5 110: ain6 must be written as 0. 0. 111: ain7 111: ain7 tmp19a71 13-22
tmp19a71 ad input port select register 0(adc1) 7 6 5 4 3 2 1 0 bit symbol adsi9 adsi8 read/write r/w reset value 0 0 0 0 0 0 0 0 function input port for result register 9 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 other: reserved input port for result register 8 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 other: reserved 15 14 13 12 11 10 9 8 bit symbol adsi11 adsi10 read/write r/w reset value 0 0 0 0 0 0 0 0 function a dcset1o(l) (0xffff_cdc8) (adcset1oh) (0xffff_cdc9) input port for result register 10 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 input port for result register 11 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 other: reserved other: reserved tmp19a71 13-23
tmp19a71 ad input port select register 1 (adc1) 7 6 5 4 3 2 1 0 bit symbol adsi13 adsi12 read/write r/w reset value 0 0 0 0 0 0 0 0 function a dcset11(l) (0xffff_cdcc) input port for result register 12 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 input port for result register 13 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 other: reserved other: reserved 15 14 13 12 11 10 9 8 bit symbol adsi15 adsi14 read/write r/w reset value 0 0 0 0 0 0 0 0 function (adcset11h) (0x ffff_cdcd) input port for result register 14 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 input port for result register 15 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 other: reserved other: reserved tmp19a71 13-24
tmp19a71 ad input port select register 2 (adc1) 7 6 5 4 3 2 1 0 bit symbol adsi17 adsi16 read/write r/w reset value 0 0 0 0 0 0 0 0 function a dcset12(l) (0xffff_cdd0) input port for result register 16 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 input port for result register 17 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 other: reserved other: reserved 15 14 13 12 11 10 9 8 bit symbol D D D D adsi18 read/write r/w reset value 0 0 0 0 0 0 0 0 function input port for result register 18 (adcset12h) (0x ffff_cdd1) 0000: ain8 0001: ain9 0010: ain10 0011: ain11 0100: ain12 0101: ain13 0110: ain14 0111: ain15 1000: ain16 1001: ain17 1010: ain18 other: reserved tmp19a71 13-25
tmp19a71 ad pmd mode control register 0 (adc0) 7 6 5 4 3 2 1 0 bit symbol adf0 D D D D D D aden0 read/write a dpmod00 (0xffff_cd5c) r r/w reset value 0 0 0 0 0 0 0 0 function conversion complete flag 0: completed 1: in progress or not sta rted yet ad conversion 0: disable 1: enable (adpmod10 used by adc1 also applies to these contents.) note 1: must be 1 as the starting condition, and it becomes 0 when all the conversions enabled are completed. note 2: if 0 is set to =0 while the conversion is in progress, the value is set to the result register after the ongoing chan nel conversion ends, and the operation stops. the next conversion starts not from the part where it stopped but from a channel of the very beginning. tmp19a71 13-26
tmp19a71 ad pmd mode control register 1 (used in adc0) 7 6 5 4 3 2 1 0 bit symbol adpe7 adpe6 adpe5 adpe4 adpe3 adpe2 adpe1 adpe0 ad pmd mode control register 1 (used in adc1) read/write r/w reset value 0 0 0 0 0 0 0 0 function result register 7 enable 0: disable 1: enable result register 6 enable 0: disable 1: enable result register 5 enable 0: disable 1: enable result register 4 enable 0: disable 1: enable result register 3 enable 0: disable 1: enable result register 2 enable 0: disable 1: enable result register 1 enable 0: disable 1: enable result register 0 enable 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol D D D D D D D D read/write r/w reset value 0 0 0 0 0 0 0 0 function must be written as 0. must be written as 0. must be written as 0. must be written as 0. must be written as 0. must be written as 0. must be written as 0. must be written as 0. 7 6 5 4 3 2 a dpmod01(l) (0xffff_cd60) (adpmod01h) (0xffff_cd61) a dpmod11(l) (0xffff_cde0) (adpmod11h) (0xffff_cde1) 1 0 bit symbol adpe15 adpe14 adpe13 adpe12 adpe11 adpe10 adpe9 adpe8 read/write r/w reset value 0 0 0 0 0 0 0 0 result register 11 function result register 15 enable 0: disable 1: enable result register 14 enable 0: disable 1: enable result register 13 enable 0: disable 1: enable result register 12 enable 0: disable 1: enable result register 10 enable 0: disable 1: enable result register 9 enable 0: disable 1: enable result register 8 enable enable 0: disable 0: disable 1: enable 1: enable 15 14 13 12 11 10 9 8 bit symbol D D D D D adpe18 adpe17 adpe16 read/write r/w reset value 0 0 0 0 0 0 0 0 result register 18 enable 0: disable 1: enable result register 17 enable 0: disable 1: enable result register 16 enable 0: disable 1: enable must be written as 0. must be written as 0. must be written as 0. must be written as 0. function must be written as 0. tmp19a71 13-27
tmp19a71 ad count enable register 0 ad count enable register 1 7 6 5 4 3 2 1 0 bit symbol note 1: at least one channel must always be converted in the unit adc1. if all the channels are converted after counting, the conversion is not skipped properly. adcne7 adcne6 adcne 5 adcne4 adcne3 adcne2 adcne1 adcne0 read/write r/w a dcne0(l) (0xffff_cd64) reset value 0 0 0 0 0 0 0 0 convert the conversion register 3 after the count 0:always enable 1:enable after the count convert the conversion register 2 after the count 0:always enable 1:enable after the count convert the conversion register 1 after the count 0:always enable 1:enable after the count convert the conversion register 0 after the count convert the conversion register 4 after the count 0:always enable convert the conversion register 5 after the count 0:always enable convert the conversion register 6 after the count 0:always enable convert the conversion register 7 after the count 0:always enable function 0:always enable 1:enable after the count 1:enable after the count 1:enable after the count 1:enable after the count 1:enable after the count 15 14 13 12 11 10 (adcne0h) (0xffff_cd65) 9 8 bit symbol D D D D D D D D read/write r/w reset value 0 0 0 0 0 0 0 0 function 7 6 5 4 3 2 1 0 bit symbol adcne15 adcne14 adcne13 adcne12 adcne11 adcne10 adcne9 adcne8 a dcne1(l) (0xffff_cde4) read/write r/w reset value 0 0 0 0 0 0 0 0 convert the conversion register 11 after the count 0:always enable 1:enable after the count convert the conversion register 10 after the count 0:always enable 1:enable after the count convert the conversion register 9 after the count 0:always enable 1:enable after the count convert the conversion register 8 after the count convert the conversion register 12 after the count 0:always enable convert the conversion register 13 after the count 0:always enable convert the conversion register 14 after the count 0:always enable convert the conversion register 15 after the count 0:always enable function 0:always enable 1:enable after the count 1:enable after the count 1:enable after the count 1:enable after the count 1:enable after t he count 15 14 13 12 11 10 adcne1(h) (0xffff_cde5) 9 8 bit symbol D D D D D adcne18 adcne17 adcne16 read/write r/w reset value 0 0 0 0 0 0 0 0 function convert the conversion register 18 after the count 0:always enable 1:enable after the count convert the conversion register 17 after the count 0:always enable 1:enable after the count convert the conversion register 16 after the count 0:always enable 1:enable after t he count tmp19a71 13-28
tmp19a71 ad conversion count setting register 0 (used in adc0) 7 6 5 4 3 2 1 0 bit symbol cmpcnt a dcnt0 (0xffff_cd68) read/write r/w reset value 0 0 0 0 0 0 0 0 function when the cycle val ue becomes the same value as the value set here, a channel set after countin g is also converted. (adcnt1 used by adc1 applies to these contents.) example of actual operation setting adpmod01=?1011_0111? : conver sion ena bled(ch0,1,2,4,5,7) adcne0 =?1111_0000? : always convert (ch0,1,2,3) o r after counting (ch4,5,6,7) adcnt0 =?0000_1111? : count value(16 counts) note 1: these are premised on that the amount of pmdtrg capable of converti ng all the channels within a certain cycle is available. 1) a channel changes from ch0 to ch1, and ch1 to ch2, then intad0 generates. 2) t he count value decrements by one. 3) go es to the step 1) if the count value is not 0, and to 4) if the value is 0 (after 16 cycles of conversion). 4) a channel changes from ch0 to ch1, ch1 to ch2, and so on till becomes ch7, then intad0 generates. 5) l oads the register value set as count set value. 6) goes back t o the step 1). ad pmd mode basic setting register (adc0) 7 6 5 4 3 2 1 0 bit symbol D D D D D azsel D D read/write r/w reset value 0 0 0 0 0 0 0 0 function must be written as 0. must be written as 0. must be written as 0. must be written as 0. must be written as 0. sample hold time a dcbasp0 (0xffff_cd6c) 1:6 clocks 0:12 clocks must be written as 0. must be written as 0. 15 14 13 12 11 10 9 8 bit symbol D D D D D D D D read/write r/w reset value 0 0 0 1 0 0 0 0 must be written as 0. function must be written as 0. must be written as 0. must be written as 1. must be written as 0. must be written as 0. must be written as 0. must be written as 0. (adcbasp1 used by adc1 app lies to these contents.) note 1: the conversion time of adc is derived from the equation; (the number of clocks selected in 27 clocks)/adclk. tmp19a71 13-29
tmp19a71 ad pmd mode clock control register 0 (used by adc0) 7 6 5 4 3 2 1 0 bit symbol D D D D D adpck read/write r r/w reset value 0 0 0 0 0 0 0 0 a dpclk0 (0xffff_cd58) prescaler clock o utput select function 000: imclk 001: imclk /2 010: imclk /4 011: imclk /8 100: imclk /16 101: fsys other: reserved (adpclk1 used by adc1 applies to these contents.) note 1: adc conversions are executed with clocks sel ected by above-mentioned registers. to guarantee the accuracy, it is necessary to select a conversion clock to make the conversion time less than 36 s (less than 14 mhz in an ad clock). note 2: a conversion clock must not be changed du rin g an ad conversion in progress. more than two clocks of adclk after the conversion stops, it must be changed. figure 13.3.2 clock control circuit 2 imclk adpck0 adclk 4 8 16 fs y s (clock for ad conversion) tmp19a71  13-30
tmp19a71 there are the same registers from 0 to 18 as the result registers. here the register 0 is described. ad pmd mode result register 0 7 6 5 4 3 2 1 0 bit symbol adr07 adr06 adr05 adr04 adr03 adr02 adr01 adr00 read/write r a dpres0 (0xffff_cd00) reset value 0 0 0 0 0 0 0 0 function lower 8 bits of an ad conversion result 15 14 13 12 11 10 9 8 bit symbol val ovr D D D D adr09 adr08 read/write r reset value 0 0 0 0 0 0 0 0 overrun flag result store flag function 0: no overrun 1: overrun 1: stored upper 2 bits of an ad conversion result note 1: to access this register, the system of more than 16-bit is to be used. when accessed by 8-bit system, the operation shall not be guaranteed. note 2: bit 15 is an ad conversion result flag . w hen an ad conversion value is stored, 1 is set to it. when this register (adpres) is read, it is cleared to 0. note 3: bit 14 is an overrun flag. 1 is set to th is flag when a conversion result is overwritten before reading the conversion result register (adpres) . it is cleared to 0 with a flag reading. note 4: this register is not accessible with any bit operation instruction. tmp19a71 13-31
tmp19a71 13.4.2 operation (pmd mode) 13.4.2.1 analog reference voltage by writing 0 to the admodsel0 bit, a switch between vrefh and vrefl can be turned off. to start an ad conversion, 1 must be written to the bit, and then it must be waited for more than 3 s until an internal reference voltage is stabilized. the conversion accuracy when the conversion is started waiting for less than 3 s shall not be guaranteed. 13.4.2.2 basic operation in pmd mode, a conversion result register becomes the reference of ad conversions. each conversion result register sets conversion enabled (adpmod01), conversion trigger (adcsett00), and input ports (adcset0x). setting 1 to adpmod00 causes the wait state of a conversion trigger. as a conversion trigger from pmd is accepted, ad conversion is executed in ascending ord er from the conversion result register of the smallest number set in the conversion enabled. an accepted conversion trigger is retained inside until the conversions of a whole unit are com pleted. when a conversion result register to be executed next is set to the trigger already accepted, a conversion starts immediately. 13.4.2.3 ad conversion counting in pmd mode, there is an ad conversion count function that enables a skip a conversion trigger (pmdtrg) of a specific result register for the set number of times. by using this function, both a result register whose conversion is desired in every cycle and a result register whose conversion cycle may delay can be controlled in the same unit. the skip, however, is not possible for all the result registers whose conversions are enabled in the unit. figure 13.3.3 shows an ad conversion operation in pmd mode. tmp19a71 13-32
tmp19a71 set 1 to adpmod00. adcnt=?0? a skip of this conversion register is invalid? (adcnex=0?) set a certain value to adcnt0 no no yes any setting input trigger ad conversion starts the last conversion register? ? an interrupt generation ? conversion register number=0 ? circuit retaining trigger is cleared ? adcnt0 is changed to -1 yes yes yes no no figure 13.3.3 pmd mode operation tmp19a71 13-33
tmp19a71 13.4.2.4 ad conversion time the number of clocks of ad conversion for one cycle is 27 excluding sampling clocks. since the adcbasp0 bit can select a sampling clock from 6 or 12 clocks, the sum of ad conversion clocks becomes 33 or 39. adpclk0 selects an ad conversion clock among an ad prescaler output fsys, imclk, imclk/2, imclk/4, im clk/8, and imclk/16. to ensure its accuracy, ad conversion clock must be set less than14mhz, i.e. more than 2.36 s of ad conversion time (when sample hold is 6 clocks). 13.4.2.5 data polling to process an ad conversion result by polling data without using any interrupt, adpmod00 should be polled. when this flag is cleared to 0, a conversion result is stored in a prescribed ad conversion result register. therefore the result resister must be read after checking the set. to detect any ove rrun at this time, a conversion result register must be read in 16-bit system. if the result came out as =0 and =1, a conversion result that was not overwritten would be gained. tmp19a71 13-34
tmp19a71 13.5 operating timing in pmd trigger mode, setting adpmod00 enables the acceptance of a pmd trigger, and inputting pmdtrg00/01 starts a converting operation. after all the program conversions end, adf is cleared as an interrupt request is output, and then the next input of pmdtrg00/01 is waited. when aden is cleared, adf is cleared without waiting for the end of all the program conversions. inputting of the same pmd trigger whose conversion is in proc ess is ignored, while a different input is retained. a program conversion of a di fferent pmd trigger is processed continuously immediately after the one of the previous trigger. aden adf intad pmdtrg00 pmdtrg01 1 2 3 1 1 2 3 figure 13.5.1 t iming chart 1 in pmd mode 1 2 3 aden adf intad pmdtrg00 pmdtrg01 1 1 2 3 figure 13.5.2 timing chart 2 in pmd mode tmp19a71 13-35
tmp19a71 13.6 example of use 13.6.1 pwm peak synchronization (read once) example of use: connect a u-phase current ct output to ain0, and v-phase current ct output to ain1. a conversion is processed at the pwm carri er peaks (pwm counter=mdprd). a result of ain0 is stored in adpres0, and a result of ain1 to adpres1. pwm counter=max(mdprd) pwm counter=1 triangular wave pwm u-phase v-phase w-phase conversion timing adf result processing figure 13.6.1 a d converter example of use 1 timing setting ? admodsel0 = **** **** **** ***1: pmd mode ? adpmod00 = **** **** **** ***1 : adc enabled ? adpmod01 = 0000 0000 0000 0011:select result register 1 or 2 ? adcset00= **** **** 0001 0000 : select ain ? adcsett00= **** **** **** 0000 : select pmdtrg0 ? t rgcr0 = **** **** **** *100 : pmd trigger setting operation ? at the first pwm carrier peak after 1 is set to aden, a conversion starts. adf becomes 1. it, however, does not start when a triangul ar wave (pwm counter) is in idle state. ? a conversion is processed in ascending order from the smallest program number (conversion register num ber). program 0 converts with ain0 as an input and put the result in adpres0. program 1 converts with ain1 as an input and put the result in adpres1. ? as adf becomes 0, an interrupt intad0 generates. result processing read adpres0 and adpres1 after checking if adf is 0 or in the interrupt processing of fin ishing all ad conversions, use them as a u-phase and v-phase currents. tmp19a71 13-36
tmp19a71 13.6.2 pwm peak synchronization (read once) example of use: connect u-phase current to ain1, v- phase current to ain2, and w-phase current to in3. the conversion is supposed to be performed at the peak of a triangular wave (pwm counter=max). the result of ain1 is store in adpres0 and 3, the result of ain2 in adpres1 and 4, and the result of ain3 in adpres2 and 5. pwm counter=max(mdprd) pwm counter=1 triangular wave pwm u-phase v-phase w-phase setting timing conversion timing adf result processing ii)setting i)setting figure 13.6.2 a d converter example of use 2 timing i) setting ? admodsel0 = **** **** **** ***1: pmd mode ? adpmod00 = **** **** **** ***1 : adc enabled ? adpmod01 = 0000 0000 0011 1111: select result register 0,1,2,3,4,or 5 ? adcset00= 0001 0011 0010 0001 : select ain ? adcset01= **** **** 0011 0010 : select ain ? adcsett00= **** 0000 0000 0000: select pmdtrg0 ? t rgcr0 = **** **** **** *100 : pmd trigger setting i) operation ? a conversion starts at the first peak of triangular wave after 1 is set to aden. adf becomes 1. ? pr ogram 0 converts with ain1 as an input and put the result in adpres0. ? pr ogram 1 converts with ain2 as an input and put the result in adpres1. ? pr ogram 2 converts with ain3 as an input and put the result in adpres2. ? pr ogram 3 converts with ain1 as an input and put the result in adpres3. ? pr ogram 4 converts with ain2 as an input and put the result in adpres4. ? pr ogram 5 converts with ain3 as an input and put the result in adpres5. ? s ince the settings of adpe7 and 6 are off, all programs end. adf becomes 0. tmp19a71 13-37
tmp19a71 13.6.3 synchronization to an optional timing of pwm cycle (read twice) example of use: connect th e dc-shunt output to ain1. a single shunt system executes conversions at the timing where all u, v, w are other than h or l. output data is to be updated every pwm cycle, and a current is to be detected every pwm cycle. pwm counter=1 pwm counter=max(mdprd) triangular wave pwm u-phase v-phase w-phase setting timing conversion timing adf result processing u v w w u v v w u figure 13.6.3 a d converter example of use 3 timing i) setting ? admodsel0 = **** **** **** ***1: pmd mode ? adpmod00 = **** **** **** ***1: adc enabled ? adpmod01 = 0000 0000 0000 1111: select a conversion register0, 1, 2, or 3 ? adcset00= 0001 0001 0001 0001 : select ain ? adcsett00= **** **** 0101 0000 : select pmdtrg0 or 1 ? t rgcr0 = **** **** **00 1001 : pmd trigger setting ? t rgcmp00 = any of cmpu-cmpv: pmd trigger timing setting ? tr gcmp01 = any of cmpv-cmpw: pmd trigger timing setting i) operation ? t rg0md and trg1md are 001 after 1 is set to aden, and trgcmp00 and 01 have effect at the max of a pwm counter. ? a conversion starts when pwm counter= trgc mp00. adf bec omes 1. program 0 and 1 with pmdtrg0 selected convert with ain1 as an input and put the results in adpres0 and 1 each. ? a conversion starts when pwm counter=t rgcmp01. program 2 and 3 with pmdtrg1 selected convert with ain1 as an input and put the results in adpres2 and 3 each. ? s ince the settings of ad7-4 are off, the program ends here. adf becomes 0. i) result processing iu=(adpres0+adpres1)/2 iw=(adpres2+adpres3)/2 ii) setting ? admodsel0 = **** **** **** ***1: pmd mode ? adpmod00 = **** **** **** ***1: adc enabled ? adpmod01 = 0000 0000 0000 1111:program 0, 1, 2, and 3 enabled ? adcset00= 0001 0001 0001 0001 : select ain ? adcsett00= **** **** 0101 0000 : select pmdtrg0 or 1 tmp19a71 13-38
tmp19a71 ? trgcr0 = **** **** **00 1001 : pmd trigger setting ? trgcmp00 = any of cmpw ? cmpu : pmd trigger timing setting ? tr gcmp01 = any of cmpu ? cmpv : pmd trigger timing setting ii) operation ? since trg 0md/trg1md=001 trgcmp00 and 01 have effect where pwm counter is the max. ? a conversion starts when pwm counter=trgcmp00. adf becomes 1. program 0 and 1 with pmdtr g0 selected converts with ain1 as an input and put the result in adpres0 and 1 each. ? a conversion starts when pwm counter=trgcmp01. program 2 and 3 with pmdtrg1 selected convert with ain1 as an input and put the results in adpres2 and 3 each. ? s ince the settings of ad7-4 are off, the program ends here. adf becomes 0. ii) result processing iw=(adpres0+adpres1)/2 iv=(adpres2+adpres3)/2 tmp19a71 13-39
tmp19a71 14. motor control circuit (p md: programmable motor driver) the tmp19a71 contains a two-channel programmabl e motor driver (pmd). in addition to a 3-phase waveform generation circu it, the pmd also has a sync samp ling signal generation circuit for sampling operations of the ad converter. by implementing these functions by hardware, the load on software can be reduced, and vector control of brushless dc motors can easily be implemented. 14.1 functional block diagram ain ad converter trg pmd 3-phase waveform gene ration circuit port u to z port emg emg sync sampling signal generation circuit tx19a core processor im bus figure 14.1.1 pm d functional block diagram tmp19a71 14-1
tmp19a71 14.2 pmd registers table 14.2.1 pmd register map address bits mnemonic register name 0xffff_c300 16 mdcr0 pmd0 control register 0xffff_c304 16 mdcnt0 pmd0 count register 0xffff_c308 16 mdprd0 pmd0 period register 0xffff_c30c 16 cmpu0 pmd0 compare register u 0xffff_c310 16 cmpv0 pmd0 compare register v 0xffff_c314 16 cmpw0 pmd0 compare register 0xffff_c318 16 mdout0 pmd0 output register 0xffff_c31c 16 emgrel0 emg0 release register 0xffff_c320 16 emgcr0 emg0 control register 0xffff_c324 16 trgcr0 trigger control register (pmd0) 0xffff_c328 16 trgcmp00 trigger compare 0 register (pmd0) 0xffff_c32c 16 trgcmp01 trigger compare 1 register (pmd0) 0xffff_c330 16 trgcmp02 trigger compare 2 register (pmd0) 0xffff_c340 16 mdcr1 pmd1 control register 0xffff_c344 16 mdcnt1 pmd1 count register 0xffff_c348 16 mdprd1 pmd1 period register 0xffff_c34c 16 cmpu1 pmd1 compare register u 0xffff_c350 16 cmpv1 pmd1 compare register v 0xffff_c354 16 cmpw1 pmd1 compare register w 0xffff_c358 16 mdout1 pmd1 output register 0xffff_c35c 16 emgrel1 emg1 release register 0xffff_c360 16 emgcr1 emg1 control register 0xffff_c364 16 trgcr1 trigger control register (pmd1) 0xffff_c368 16 trgcmp10 trigger compare 0 register (pmd1) 0xffff_c36c 16 trgcmp11 trigger compare 1 register (pmd1) 0xffff_c370 16 trgcmp12 trigger compare 2 register (pmd1) note: these registers must be accessed as a 16-bit quantity, unless otherwise noted. these registers do not support bit manipulation instructions. tmp19a71 14-2
tmp19a71 14.3 pmd components the two pmd channels are, essentially, functionally equivalent so that only pmd0 is expla ined here. 14.3.1 three-phase waveform generation circuit pwm conduction control protection control dead time control mdprd0 cmpu0 cmpv0 cmpw0 mdcr0 mdout0 u x v y w z emgcr0 mdcr0 emgrel0 intemg0 intpmd0 u x v y w z u? x? v? y? w? z? pwmu pwmv pwmw pwmsync emg0 mdcnt0 port control figure 14.3.1 three-phase waveform generation circuit the 3-phase waveform generation circuit consists of a pulse width modulation (pwm) c ircuit, a conduction control circuit, an emg pr otection (emergency stop) circuit and a dead time control circuit. the pulse width modula tion circuit generates independent 3-phase pwm waveforms with the same pwm carrie r wave. the conduction control circuit determines the output pattern for each of the upper and lower sides of the u, v and w phases. the emg protection circuit enables emergency output stop by emg0 input. the dead time control circuit prevents a short circuit which may occur when the upper side and lower side are switched. tmp19a71 14-3
tmp19a71 14.3.2 pulse width modulation circuit (pwm waveform generation unit) pwm control ?? xk imclk pwm sync clock pwmsync pwmu0 pwmv0 pwmw pwm interrupt intpwm0 mdcr0 15-8 | 7 | 6 | - | - | 3,2,1 | 0 bufferu bufferv bufferw mdprd0 15-0 cmpu0 15-0 cmpv0 15-0 cmpw0 15-0 selector/ latch selector 0x0001 3 mdcnt0 15-0 up/down pmd control register pwm counter register pwm period register pwm compare register pwm counter to sync sampling signal generation circuit figure 14.3.5 figure 14.3.2 pulse width modulation circuit the pulse width modulation circuit has a 16-bit up-/down-counter (pwm counter) and generates pwm carrier waves wi th a resolution of 35.7 ns (imclk = 28 mhz). the pwm carrier wave mode can be selected from the following two modes: pwm mode 0 : edge pwm (sawtooth wave modulation) pwm mode 1 : center pwm (triangular wave modulation) the mdprd0 register is used to specify the pwm period. the mdprd0 is dou ble-buffered and the comparator input is updated at every pwm period or at every half pwm period. imclk [hz] sawtooth wave pwm : mdprd0 register value = DDD DDDDDD DD DD pwm frequency [hz] imclk [hz] triangular wave pwm : mdprd 0 register value = DDDDDDDDDDDDDDD pwm frequency x 2 [hz] tmp19a71 14-4
tmp19a71 the pulse width modulation circuit compares the pwm compare registers of the 3 phases (cmpu0, cmpv0, cmpw0) and the carrier wave generated by the pwm counter (mdcnt0) to determine which is larger to generate pwm waveforms with the desired duty. the pwm compare register of each phase has a compare register (double-buffer structure ). the pwm compare register value is loaded into the corresponding compare register at every pwm period (when the internal counter value matches the mdprd0 value). it is also po ssible to update the compare register at every half pwm period. [sawtooth wave] [ triangular wave] mdcnt0 time on off pwmu waveform [ mdprd0 ] [ cmpu0 ] mdcnt0 time on off pwmu waveform mdcnt0 counts up to the mdprd0 value and it is then cleared to 0 in the next cycle. when up-counting switches to down-counting, the peak value (mdprd0) continues for two cycles. when down-counting switches to up-counting, the value 1 continues for two cycles. [ mdprd0 ] [ cmpu0 ] figure 14.3.3 pwm waveforms three-phase pwm waveforms can be gene rated in the following two modes: (1) 3-phase independent mode: each of the pwm compare registers for the three phases is set independently to g enerate independent pwm waveforms for each phase. this mode is used to generate drive waveforms such as sinusoidal waves. (2) 3-phase common mode: only the u-phase pwm compare register is set to generate identical pwm wav eforms for all the three phases. this mode is used for rectangular wave drive of brushless dc motors. tmp19a71 14-5
tmp19a71 the pulse width modulation circuit generates pwm interrupt requests in synchronization with pwm waveforms. the pwm interrupt period can be set to half a pwm period, one pwm period, two pwm periods, or four pwm periods. when the pwm interrupt period is set to two or four pwm periods, the first interrupt aft er the counter is started occurs at any timing in the specified period. for example, if an interrupt is to be generated at every four pwm periods, the first interrupt will be generated any time during the first to fourth pwm periods with the second and subsequent interrupts generated at every fourth pwm period. mdprd0=0x100 0x003 0x002 0x001 0x002 intpmd0 intprd0=0x0 (0.5 period) 0x097 ?? pwm counter mdcnt0 0x001 pwm period mdprd0 0x100 0x105 0x098 0x099 0x100 0x105 0x104 0x103 0x102 time mdcnt0 mdprd0=0x105 if the mdprd0 is reloaded during this period, the counter counts up to the value previously set in the mdprd0 and then starts counting down from the new value. figure 14.3.4 mdprd0 reload timing (triangular wave, interrupt at every 0.5 pwm period) tmp19a71 14-6
tmp19a71 pmd0 control register 7 6 5 4 3 2 1 0 mdcr0 bit sy mbol updwn syncen dtymd pint intprd pwmmd pwmen (0xffff_c300) read/write r r/w r/w r/w r/w r/w r/w reset value 0 0 0 0 0 0 0 function 15 14 13 12 11 10 9 8 bit sy mbol dtr read/write r/w reset value 0x00 symbol name function updwn pwm counter flag 0: up-counting 1: down-counting syncen pmd synchronized start 0: disable synchronized start 1: enable synchronized start dtymd duty mo de 0: 3-phase common mode 1: 3-phase independent mode pint pwm interrupt timing 0: interrupt request when pwm counter = 1 1: interrupt request when pwm counter = mdprd [pwm counter = mdprd when edge mode is selected (pwmmd=0). pwm counter = 1 or mdprd when 0.5 pwm period is selected (intprd=00).] intprd pwm interrupt period 00: interrupt request at every 0.5 pwm period (pwm mode1: triangular waves only) 01: interrupt request at every pwm period 10: interrupt request at every 2 pwm periods 11: interrupt request at every 4 pwm periods pwmmd pwm mode 0: pwm mode 0: edge pwm (sawtooth waves) 1: pwm mode 1: center pwm (triangular waves) pwmen pwm counter start 0: stop & clear 1: start note: the settings in the mdcr0 register must be changed while the pwmen bit is 0. it is also not allowed to change the mdcr0 se ttings at the same time as writing to the pwmen bit to start or stop the pwm counter. tmp19a71 14-7
tmp19a71 pmd0 count register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit sy mbol mdcnt mdcnt0 read/write r (0xffff_c304) reset value 0x0000 function pwm counter value: 0x0001 to 0xffff pmd0 period register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit sy mbol mdprd mdprd0 read/write r/w (0xffff_c308) reset value 0x0000 function pwm carrier wave period (must be within 0x0010 to 0xffff.) note: this register is double-buffered; the value written to this register takes effect when mdcnt0 = mdprd0. pmd0 compare registers (u, v, w) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cmpu0 bit sy mbol cmpu (0xffff_c30c) cmpv cmpv0 cmpw (0xffff_c310) read/write r/w cmpw0 reset value 0x0000 (0xffff_c314) cmpu0 pwm compare u register 0x0000 to 0xffff: u-phase pulse width duty cmpv0 pwm compare v register 0x0000 to 0xffff: v-phase pulse width duty cmpw0 pwm compare w register 0x0000 to 0xfff: w-phase pulse width duty note 1 : when cmpx0=0, a 0%-duty cycle waveform is generated. when cmpx0 R mdprd0, a 100%-duty cycle waveform is generated. note 2 : these registers are double-buffered; the values written to these registers take effect when mdcnt0 = mdprd0. tmp19a71 14-8
tmp19a71 detailed description of the pmd0 registers symbol name function updwn pwm counter flag indicates whether the pwm counter is up-counting or do wn-counting. when edge pwm is selected, this bit is always read as 0. syncen pmd synchronized start enables t he pmd s ynchronized start function. dtymd duty mode selects whether to make duty setting independently for each phase or to use the cmpu register s etting for all three phases. pint pwm interrupt timing selects whether to genera te an interrupt when pwm counter equals 1 or the mdprd value. intprd pwm interrupt period selects the pwm interrupt period from 0.5 pwm period, one pwm period, two pwm periods and f our pwm periods. if this bi t is changed during operation, an interrupt may occur at that time. pwmmd pwm mode selects pwm mode 0 (edge pwm, sawtooth wave) or pmw mode 1 (center pwm, triangular w ave). pwmen waveform generation circuit enable/disable when this bit is cleared to stop and clear the pwm counter, output ports become high-impedance. before setting this bit to 1 to start the pwm counter, it is necessary to set all the other bits in the mdcr0 register. while this bit is set to 1, do not change the mdcr0 settings other than the pwmen bit. mdcnt pwm counter a 16-bit counter for reading th e pwm period count value. mdprd pwm period a 16-bit register for specifying the pwm period. this register is double-buffered and can be changed even when the pwm counter is counting. the buffer is loaded at every pwm period. (that is, when the pw m counter matches the mdprd value. when 0.5 pwm period is selected, loading is performed when the pwm counter matches 1 or mdprd0.) see figure 14.3.4. cmpu cmpv cmpw pwm pulse width 16-bit compare registers for determining the output pulse width of u, v and w phases. these registers are double-buffe red. pulse width is determined by comparing the buffer and the pwm counter to evaluate which is larger. when cmpx0 = 0, a 0% duty-cycle waveform is generated. when cmpx0 >= mdprd0, a 100% duty-cycle waveform is generated. (to be loaded when the pwm counter matches the mdprd value. when 0.5 period is selected, loading is performed when the pwm counter matches 1 or mdprd.) setting the syncen bit of the mdcr0 register to 1 enables the pmd synchronized start function. when the pwmen bit of the mdcr0 is set to 1 with the pmd synchronized start function enabled, pmd0 is put on standby for starting as soon as th e pwmen bit of the mdcr1 is set to 1 to start pmd1. by setting the syncen and pwmen bits simultaneously, pmd0 can be put on standby for synchronized start. when the synchronized start function is enabled for both pmd0 and pmd1 (mdcr0.syncen=1, md cr1.syncen=1), the channel that is enabled first (mdcrx.pwmen bit=1) is put on standby and starts operating as soon as the other channel is enabled. even when the synchronized start function is enabled, registers are set independently for each channel. t o operate pmd0 and pmd1 with the same conditions, it is necessary to set the pmd0 and pmd1 registers identically. example: to start pmd0 in synchronization with pmd1 mdcr0 = 0y********_*1*****1 ; s yncen=1 (enable the synchronized start function.) ; pwmen=1 (put pmd0 on standby.) mdcr1 = 0y********_*******1 ; pwmen=1 (s tart pmd1.) tmp19a71 14-9
tmp19a71 14.3.3 conduction control circuit mdout0 u x v y w z pwmu pwmv pwmw pwm sync imclk s selector 6 3 pmd output register latch --- 12,11 10,9,8 7,6 5,4,3,2,1,0 2 2 fig.12.3.7 continued from fig.12.3.2 continue to fig. 14.3.6 figure 14.3.5 conduction control circuit the conduction control circuit performs output port control according to the settings made in the pmd output register (mdout0). the mdout0 register bits are divided into two parts: settings for the synchronization signal for port output and settings for port output. the latter part is double-buffered and update timing can be set as synchronous or asynchronous to pwm. the output settings for six port lines are made independently for each of the upper and lo wer phases through the polh and poll bits of the mdout0 register. in addition, the uoc, voc and woc bits of the mdout0 register are used to select pwm or h/l output for each of the u, v, and w phases. when pwm output is selected, pwm waveforms are output. when h/l output is selected, output is fixed to either a high or low level. table 14.3.1 shows a sum mary of u-phase port outputs according to port output and polarity settings in the mdout0. tmp19a71 14-10
tmp19a71 pmd0 output register 7 6 5 4 3 2 1 0 mdout0 bit sy mbol psyns woc voc uoc (0xffff_c318) read/write r/w r/w r/w r/w reset value 0 0 0 0 15 14 13 12 11 10 9 8 bit sy mbol polh poll wpwm vpwm upwm read/write r r r r/w r/w r/w r/w r/w reset value 0 0 0 0 0 0 0 0 symbol name function polh upper phase port polarity 0: low active 1: high active poll lower phase port polarity 0: low active 1: high active wpwm w-phase pwm output 0: h/l output 1: pwm waveform output vpwm v-phase pwm output 0: h/l output 1: pwm waveform output upwm u-phase pwm output 0: h/l output 1: pwm waveform output psyncs mdout transfer timing 00: async to pwm 01: load when pwm counter 1 10: load when pwm counter = mdprd 11: load when pwm counter = 1 or mdprd woc -phase output control voc -phase output control see table 14.3.1 . uoc -phase output control note 1: before changing the polh, poll and psyncs bits of the mdout0 register, make sure that the mdcr0.pwmen bit is cleared to 0. note 2: the xpwm and xoc bits of the mdout0 register are do uble-buffered; the values written to these bits take effect according to the timing selected in the mdout0.psyncs field. tmp19a71 14-11
tmp19a71 table 14.3.1 s ummary of u-phase port outputs according to the uoc and upwm settings polarity: active hi gh (polh, poll=1 polarity: active low (polh, poll=0) mdout0 mdout0 mdout 0: h/l output 1: pwm output mdout 0: h/l output 1: pwm output bit 1 bit 0 u output x output u output x output bit 1 bit 0 u output x output u output x output 0 0 l l DDDDD pwm pwm 0 0 h h pwm DDDDD pwm 0 1 l h l pwm 0 1 h l h DDDDD pwm 1 0 h l pwm l 1 0 l h DDDDD pwm h 1 1 h h pwm DDDDD pwm 1 1 l l DDDDD pwm pwm the voc and vpwm bits and the woc and wpwm bits should be set for the v phase and the w phase, respectively, as shown in the above table. name symbol function output port polarity poll, polh select the output port polarity for the upper and lower phases. set these bits w hen mdcr0.pwmen=0. port output sync setting psyncs select port output timing for the u, v and w phases. select either mdcnt0 (pmd0 comp are register) peak/bottom sync or async. u-, v-, w-phase output control uoc, voc, woc, upwm, vpwm, wpwm specify port output settings for the u, v and w phases (see table 14.3.1 ). tmp19a71 14-12
tmp19a71 14.3.4 emg protection circuit emg protection control emgcr0 - - - - - | 2 | 1 | 0 u x v y w z emgrel0 7,6,5,4,3,2,1,0 pemg0 intemg0 u? x? v? y? w? z? 3 8 emg control register emg release register emg signal from emg port emg interrupt request pwm continued from figure 12.3.5 to continue to figure 12.3. 7 figure 14.3.6 emg protection circuit the emg protection circuit is activated when the emg input from the emg0 (pa6) pin becomes the active state specified in the port a emg control register (paecr). when the pa6 pin is not configured as an emg input pin, the emg protection circuit does not function. the emg protection circuit offers an emergency stop mechanism: when the emg input is asserted, an emg int errupt request (intemg0) is generated and the pmdtrg0 output to the ad converter is disabled. when only the pmd is protected with the emg input pin enabled, all six port output lin es output inactive signals. emg protection is set through the emg control register (emgcr0). a read value of 1 in the emgst bit of th e emgcr0 indicates that th e emg protection circuit is active. in this state, emg protection can be released by setting all the port output lines inactive (mdout[10:0]= 00000000000) and then setting the emgrs bit of the emgcr0 to 1. to disable the emg protection function, the following sequence of operations must be per formed consecutively. this sequence becomes invalid if it is interrupted by any operation on the emgcr0 or emgrel0 register before it is completed. 1) write 0x5a in the emgrel0 register. 2) write 0xa5 in the emgrel0 register. 3) clear the emgen bit of the emgcr0 register to 0. if protection is released in the emg prot ect ion circuit while the emg input pin is asserted, protection is applied again. for de tails about the port settings related to the emg protection function, see section 8.12 notes on using the emg input pins (pa6, pa8). tmp19a71 14-13
tmp19a71 emg0 release register 7 6 5 4 3 2 1 0 bit sy mbol emgrel emgrel0 read/write w (0xffff_c31c) reset value 0x00 function the emg protection circuit can be disabled by writing 0x5a and 0xa5 in this order to this register and then clearing emgcr0.emgen bit to 0. emg0 control register 7 6 5 4 3 2 1 0 bit sy mbol emgst emgrs emgen emgcr0 read/write r r r r r r w r/w (0xffff_c320) reset value 0 0 0 0 0 0 0 1 symbol name function emgst emg protection state 0: DD 1: protected emgrs emg protection release 0: DD 1: release protection emgen emg protection circuit enable/disable 0: disable 1: enable detailed description of the emg control register name symbol function emg protection state emgst the emg protecti on st ate can be known by reading this bit. emg protection release emgrs emg protection can be released by setti ng mdout[10:0] to 00000000000 and then setting the emgrs bit to 1. emg protection circuit enable/disable emgen the emg protection circuit is enabled by setting this bit to 1. in the initial state, the emg prot ection circuit is enabled. to disable this circuit, write 0x5a and 0xa5 in this order to the emgrel0 register and then clear the emgen bit to 0. tmp19a71 14-14
tmp19a71 14.3.5 dead time control circuit mdcr0 15 8 | - | - | - | - | - | - | - | - u x imclk v? y? on delay circuit on delay circuit on delay circuit w? z? u? x? v y w z output polarity switching unit dead time unit mdout0 pmd output register ---12,1 1 -,-,- -,- -,-,-,-,-,- pmd control register 1/2 continued from figure 14.3.6 figure 14.3.7 dead time control circuit the dead time control circuit consists of a dead time unit and an output polarity switching unit. for each of the u, v, and w phases, the on d elay circuit introduces a delay (dead time) when the upper and lower phases are switched to prevent a short circuit. the dead time is set to the dtr field in the mdcr0 register as an 8-bit value with a resolution of 71.4 ns (at imclk = 28 mhz). no delay time is inserted when dtr=0x00. the output polarity switching unit allows the polarity (active high or active low) of the upp er and lower phases to be independently set through the polh and poll bits of the mdout0 register. pmd0 control register 7 6 5 4 3 2 1 0 mdcr0 bit sy mbol updwn - dt ymd pint intprd pwmmd pwmen (0xffff_c300) read/write r r/w r/w r/w r/w r/w r/w reset value 0 0 0 0 0 0 0 function must be set to 0. 15 14 13 12 11 10 9 8 bit sy mbol dtr read/write r/w reset value 0x00 function dead time: 71.4 ns 8 bits (max. 18.2 s imclk = 28 mhz tmp19a71 14-15
tmp19a71 14.3.6 sync sampling signal generation circuit mdcnt0 trgcmp00 pmdtrg01 pmdtrg00 trgcmp01 3-phase waveform generation circuit ad converter control circuit tbuf00 tbuf01 trgcr0 pwm sync signal pwm sync pwm sync pmdtrg02 trgcmp02 tbuf02 pwm sync slope selection figure 14.3.8 sync sampling signal generation circuit the sync sampling signal generation circuit gen erates trigger sign als for starting adc sampling in synchronization with pwm. the adc trigger signal (pmdtrg0) is generated by a match between the mdcnt0 and trgcmp0. the signal generation timing can be selected from up-count match, down-count match, and up-/down-count match. when the edge pwm mode is selected, the adc trigger signal is generated on an up-count match. when pwm output is disabled (mdcr0.pwmen=0 ) or emg protection is applied, trigger output is also disabled. tmp19a71 14-16
tmp19a71 trigger control register (pmd0) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit sy mbol trg2md trg1md trg0md trgcr0 read/write r r r r r r r r/w r/w r/w (0xffff_c324) reset value 0 0 0 0 0 0 0 000 000 000 symbol name function trg2md pmdtrg2 mode setting trg1md pmdtrg1 mode setting trg0md pmdtrg0 mode setting 000: trigger output disabled 001: trigger output on down-count match 010: trigger output on up-count match 011: trigger output on up-/down-count match 100: trigger output at pwm carrier peak 101: trigger output at pwm carrier bottom 110: trigger output at pwm carrier peak/bottom 111: DD note: the trg0md, trg1md and trg2md fields must be set while mdcr0.pwmen=0. trigger compare registers (pmd0) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 trgcmp02 bit symbol D (0xffff_c330) read/write r/w trgcmp01 reset value 0x0000 (0xffff_c32c) function pmdtrg0 is output on a match between this register and mdcnt0. trgcmp00 (0xffff_c328) note1: the trigger compare registers must be set to satisfy the following conditions: 1 rgcmp00, trgcmp01, trgcmp02 mdprd0 note 2: these registers are double-buffered; the values written to these registers take effect at the following timi ngs: trgxmd=001: the register values take effect when mdcnt0=mdprd0. trgxmd=010: the register values take effect when mdcnt0=0. trgxmd=011: the register values take effect when mdcnt0=mdprd0 or 0. tmp19a71 14-17
tmp19a71 15. encoder input circuit 15.1 functional overview (1) allows direct input of the incremental encoder signal. (2) co ntains a x4 multiplier circuit and a rotation direction control circuit. (3) conta ins an absolute position detection counter. (4) gen erates an interrupt on a match with the encoder pulse position set value. (5) incorp orates noise filters in the signal input part. noise filter select decoder interrupt request control interrupt request intenc enca encb encz noise filter noise filter figure 15.1.1 block diagram of the encoder input circuit note: unless otherwise specified, the registers for the encoder input circuit must be accessed as a 16-bit quantity. bit manipulation instructions cannot be used on these registers. tmp19a71 15-1
tmp19a71 15.2 register description encoder input control register 7 6 5 4 3 2 1 0 entncr bit symbol zen cunen nr1 nr0 encap (0xffff_c400) read/write r/w reset value 0 0 00 0 0 0 0 15 14 13 12 11 10 9 8 bit symbol enclr u/d zdet read/write w r reset value 0 0 0 0 0 0 0 0 symbol name function enclr encoder pulse counter clear writing a 1 and then a 0 to this bit clears the encoder counter. u/d encoder rotation direction 1: cw 0: ccw zdet phase z detection state 1: phase z is detected. 0: the cunen bit is set to 1 or a reset is applied. zen counter clear by phase z 1: enable 0: disable cunen encoder pulse counter enable 1: enable 0: disable nr[1:0] noise filter 00: no filter 01: eliminate pulses of less than 31/imclk as noise 10: eliminate pulses of less than 63/imclk as noise 11: eliminate pulses of les than 127/imclk as noise encap encoder interrupt request enable 1: enable 0: disable note 1: the entncr register must be set after all the other relevant registers have been set. note 2: do not change the settings in this register other the enclr and cunen bits while the encoder counter is operating. note 3: if the cunen bit is cleared to 0 when encnt=enint, the intenc interrupt is generated. note 4: to re-enable the encoder counter after disabling it by cunen=0, clear the counter value by using the enclr bit. tmp19a71 15-2
tmp19a71 t able 15.2.1 detailed description of the encoder input control register name symbol function encoder pulse counter clear enclr writing a 1 and then a 0 to th is bit clears the encoder counter to 0. then, the counter starts counting again. encoder rotation direction u/d when the motor is rotati ng in c w direction (phase a of the incremental encoder signal is 90 degrees ahead of phase b), this bit is set to 1. when the motor is rotating in ccw direction (phase a is 90 degrees behind phase b), this bit is cleared to 0. z phase detection state zdet this bit is cleared to 0 when a 1 is written to the cunen bit and at reset. it is set to 1 on the next zdetect?the signal to be output on the rising edge (cw direction) or falling edge (ccw direction) of the increm ental encoder signal phase z. (this bit is independent of the zen value.) counter clear by phase z zen when the motor is rotating in cw direction, this bit is cleared to 0 on the rising edge of phase z (zdetect). when the motor is ro tating in ccw direction, this bit is cleared to 0 on the falling edge of phase z (zdetect). if enclk (a clock obtained by multiplying the phase a and phase b signals by 4) and zdetect coincide with each other, the counter is cleared to 0 without counting. encoder pulse counter enable cunen when cunen=1, the zdet bit is cleared to 0 and the encoder cou nter (encnt) is enabled. when cunen=0, the encoder counter is disabled. noise filter nr1,0 00: no filter 01: eliminate pulses of less than 31/imclk as noise (1.11 s imclk = 28 mhz) 10: eliminate pulses of less than 63/imclk as noise (2.25 s imclk = 28 mhz) 11: eliminate pulses of less than 127/imclk as noise (4.54 s imclk = 28 mhz) encoder interrupt request encap encap=1 enables interrupt requ est signal generation. e ncap=0 disables interrupt request signal generation. tmp19a71 15-3
tmp19a71 encoder counter reload register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 enreload bit symbol (0xffff_c404) read/write r/w reset value 0x0000 function encoder counter target value: 0x0000 to 0 xffff (input pulse count multiplied by 4) when phase z is used: set the number of pulses r equired for one rotation when phase z is not used: set the number of pulses required for one rotation minus one when the encoder counter (encnt) is up-counting, the counter is zero-cleared on the next enclk tim ing after the count value reaches the enreload value. when the encoder counter (encnt) is down-counting, it is re-loaded with the enreload value on the next enclk timing after the counter value reaches 0. encoder compare register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 enint bit symbol (0xffff_c408) read/write r/w reset value 0x0000 function interrupt request generation position: 0x0000 to 0xffff when the encoder counter matches the value set in this register , an interrupt request is generated. when the encoder counter (encnt) value reaches th e enint value, an interrupt request (intenc ) is generated. when zen=1, however, an interrupt requ est is not generated until the zdet bit is set to 1. encoder counter 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 encnt bit symbol (0xffff_c40c) read/write r reset value 0x0000 function 0x0000 to 0xffff: up-/down counter that counts encoder pulses when the motor is rotating in cw direction, the enco d er counter is an up-counter to be zero-cleared on the next enclk timing after the count value reaches the enreload value. when the motor is rotating in ccw direction, the encoder counter is a down-co unter to be re-loaded with the enreload value on the next enclk timing after the count value reaches 0. tmp19a71 15-4
tmp19a71 15.3 operation phase a input enca cw ccw motor rotation direction rotation direction state u/d phase b input encb phase z input encz encoder pulse enclk phase z detection zdetect encoder counter encnt 0x100 0x101 0x0 0x1 0x2 0x3 0x2 0x1 0x1 0x0 0x0 0x5db 0x5da initial rotation (zdet=0) intenc enint=0x2 0x4 ?? ?? figure 15.3.1 encoder input circuit timi ng ch art (1) (zen=1, enreload=0x05db) phase a input enca cw ccw motor rotation direction rotation direction state u/d phase b input encb encoder pulse enclk counter clear encoder counter encnt 0x100 0x101 0x0 0x102 0x1 0x103 0x2 0x1 0x1 0x0 0x0 0x5db 0x5da intenc enint=0x2 0x2 ?? ?? set enclr set enclr figure 15.3.2 encoder input circuit timing chart (2) (zen=0, enreload=0x5db) tmp19a71 15-5
tmp19a71 (1) each incremental encoder signal is connected to phase a, phase b, and phase z, respectively. this signal is multiplied by four for being counted. (2) when the motor is rotating in cw direction (phase a is 90 degrees ahead of phase b), the encoder count er operates as an up-counter. when the count value reaches the enereload value, the counter is zero-cleared on the next enclk timing for counting up. (3) when the motor is rotating in ccw direction (phas e a is 90 degrees behind phase b), the encoder counter operates as a down-counter. when the count value reaches 0, the counter is re-loaded with the enreload value on the next enclk timing for counting down. (4) when zen=1, the encoder counter is zero-cleared on the rising edge of phase z (zdetect) while the m otor is rotating in cw direction and on the falling edge of phase z (zdetect) in the case of ccw direction. when enck and zdetect coincide with each other, no count operation is performed and the counter is zero-cleared. (5) when a 0 is written to the enclr bit, the counter is zero-cleared. (6) an interrupt request can be generated when the counter value reaches the enint value. when zen=1, h owever, an interrupt request cannot be generated until the zdet bit is set to 1. (7) the zdet bit is zero-cleared when a 1 is writte n to the cu nen bit and at reset, and it is set to 1 on the next zdetect timing (regardless of the zen value). (8) the u/d bit is set to 1 when cw rotation is d etected and to 0 when ccw rotation is detected. tmp19a71 15-6
tmp19a71 15.4 how to use the encoder input circuit 15.4.1 using the encoder interrupt request (1) set the encoder pulse count. assuming that the encoder requires 1200 pulses for one rotation, the pulse count (after be ing multiplied by 4) is set as follows: enreload=1200x4=0x12c0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 1 1 (2) set the encoder compare register value. for generating an interrupt request at counter value = 1000 (03e8 h ), the encoder compare register is set as follows: enint=0x03e8 0 0 0 0 0 0 1 1 1 1 1 0 1 0 0 0 (3) enable the encoder counter, interrupt request, and z-phase detection. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 entncr - - - - - - - - -- --- (4) operation 1. as the encoder rotates, the encoder deco de r outputs x4 pulses (enclk) and rotation direction (u/d). 2. the encoder counter counts enclk pulses. whether to count up or down is det ermined by rotation direction. 3. when phase z is detected, the encoder counter is cleared. in th e case of up-counting, when the count value matches the enreload register value, the counter is zero-cleared on the next enclk timing. in the case of down-counting, when the count value reaches 0, the counter is re -loaded with the enreload register value on the next enclk timing. 4. up to the first z-phase detection, the encoder counter value indicates not the absolut e position of the actual encoder but th e relative position from count start time. when phase z is detected, the zdet is set to 1 and the counter value now indicates the absolute position. 5. when a match occurs between the encode r compar e register (enint) value and the encoder count value and the zdet is set to 1, an enint interrupt request is generated. this interrupt request is ge nerated regardless whether the counter is counting up or down. tmp19a71 15-7
under development tmp19a71 16. rom correction this chapter describes the rom correctio n function supported by the tmp19a71. note: the registers for the rom correction function must be accessed as a 32-bit quantity. bit manipulation instructions cannot be used on these registers. 16.1 features up to eight 8-word sequences of data can be replaced. ? ? ? ? when the physical address stored in an address register (a ddregn) matches the program counter (pc) value or the address ge nerated by the dmac (the lower five bits of the address are ?don?t care?), the data at the specified address in the on-chip rom is replaced with the data from the ram area corresponding to the address register. writing an address to an address register caus es rom correction for the address to be enabled automatically. a reset is required to disable the rom correction function. a correction requiring the replacement of mo r e than eight words can be performed by replacing the rom data with an instruction code which makes a branch to a specified location in the ram area which contains substitution data. 16.2 operation to correct data in a rom area (or a projected rom area), store the physical address of the area in an address register (addregn). store the substitution data in the ram area corresponding to the address register. writing an address to an addre ss register causes rom correction for the address to be enabled automati cally. upon reset, the rom correction function is disabled. if the initial routine executed upon reset is used to correct rom data, write a physical address to the relevant address register after a reset is released. the address registers to which addresses are written are enabled for rom correction. when the stored address matches the pc value (if the tx19a core processor owns the bus) or the source or destination address issued by the dmac (if the dmac owns the bus), the data at the specified address in the rom is replaced with the data stored in the corresponding ram area. for example, storing addresses in the addreg0 and addreg3 enables correction for the respec tive rom areas, so that the rom correction circuit block constantly monitors the pc and dmac-issued addresses for a match with a specified address and, if a ma tch is detected, replaces data, while ignoring the addreg2 and addreg4 to addreg7. each a ddress register has bits 31:5 although only bits 17:5 are used for address comparison, in order to simplify the circuit. a match detected in the rom correction circuit is internally anded with the romcs signal, which indicates a specified rom address block, to determine an exact match. rom a ddresses specified for correction must be located on ei ght-word boundaries, i.e., the lower five bits are 0. in other words, rom data is always replaced in 32-byte units. if only part of 32 bytes needs to be replaced, substitution ram data corresponding to the other bytes must be the same as the current data in the corresponding rom addresses. txmp9a70 16-1
tmp19a71 the following table shows the relationship between the address registers and ram areas. table 16.2.1 relationship between t he addregn registers and ram areas address register ram area addreg0 0xffff_bf00 to 0xffff_bf1f addreg1 0xffff_bf20 to 0xffff_bf3f addreg2 0xffff_bf40 to 0xffff_bf5f addreg3 0xffff_bf60 to 0xffff_bf7f addreg4 0xffff_bf80 to 0xffff_bf9f addreg5 0xffff_bfa0 to 0xffff_bfbf addreg6 0xffff_bfc0 to 0xffff_bfdf addreg7 0xffff_bfe0 to 0xffff_bfff tx19a core processor compare circuit address registers addregx converter ram rom g-bus compare enable compare address [17:5] load/fetch address [17:5] ramcs signal romcs signal ram data rom data conversion address address conversion enable figure 16.2.1 rom corr ection block diagram tmp19a71 16-2
under development tmp19a71 16.3 registers (1) address registers 7 6 5 4 3 2 1 0 addreg0 bit symbol add07 add06 add05 (0xffff_e540) read/write r/w reset value 0 0 0 1 1 1 1 1 function 15 14 13 12 11 10 9 8 bit sy mbol add015 add014 add013 add012 add011 add010 add09 add08 read/write r/w reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit sy mbol add023 add022 add021 add020 add019 add018 add017 add016 read/write r/w reset value 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit sy mbol add031 add030 add029 add028 add027 add026 add025 add024 read/write r/w reset value 0 0 0 0 0 0 0 0 function 7 6 5 4 3 2 1 0 addreg1 bit symbol add17 add16 add15 (0xffff_e544) read/write r/w reset value 0 0 0 1 1 1 1 1 function 15 14 13 12 11 10 9 8 bit sy mbol add115 add114 add113 add112 add111 add110 add19 add18 read/write r/w reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit sy mbol add123 add122 add121 add120 add119 add118 add117 add116 read/write r/w reset value 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit sy mbol add131 add130 add129 add128 add127 add126 add125 add124 read/write r/w reset value 0 0 0 0 0 0 0 0 function txmp9a70 16-3
tmp19a71 7 6 5 4 3 2 1 0 addreg2 bit symbol add27 add26 add25 (0xffff_e548) read/write r/w reset value 0 0 0 1 1 1 1 1 function 15 14 13 12 11 10 9 8 bit sy mbol add215 add214 add213 add212 add211 add210 add29 add28 read/write r/w reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit sy mbol add223 add222 add221 add220 add219 add218 add217 add216 read/write r/w reset value 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit sy mbol add231 add230 add229 add228 add227 add226 add225 add224 read/write r/w reset value 0 0 0 0 0 0 0 0 function 7 6 5 4 3 2 1 0 addreg3 bit symbol add37 add36 add35 (0xffff_e54c) read/write r/w reset value 0 0 0 1 1 1 1 1 function 15 14 13 12 11 10 9 8 bit sy mbol add315 add314 add313 add312 add311 add310 add39 add38 read/write r/w reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit sy mbol add323 add322 add321 add320 add319 add318 add317 add316 read/write r/w reset value 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit sy mbol add331 add330 add329 add328 add327 add326 add325 add324 read/write r/w reset value 0 0 0 0 0 0 0 0 function tmp19a71 16-4
under development tmp19a71 7 6 5 4 3 2 1 0 addreg4 bit symbol add47 add46 add45 (0xffff_e550) read/write r/w reset value 0 0 0 1 1 1 1 1 function 15 14 13 12 11 10 9 8 bit sy mbol add415 add414 add413 add412 add411 add410 add49 add48 read/write r/w reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit symbol add423 add422 add421 add420 add419 add418 add417 add416 read/write r/w reset value 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit symbol add431 add430 add429 add428 add427 add426 add425 add424 read/write r/w reset value 0 0 0 0 0 0 0 0 function 7 6 5 4 3 2 1 0 addreg5 bit symbol add57 add56 add55 (0xffff_e554) read/write r/w reset value 0 0 0 1 1 1 1 1 function 15 14 13 12 11 10 9 8 bit sy mbol add515 add514 add513 add512 add511 add510 add59 add58 read/write r/w reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit sy mbol add523 add522 add521 add520 add519 add518 add517 add516 read/write r/w reset value 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit sy mbol add531 add530 add529 add528 add527 add526 add525 add524 read/write r/w reset value 0 0 0 0 0 0 0 0 function txmp9a70 16-5
tmp19a71 7 6 5 4 3 2 1 0 addreg6 bit symbol add67 add66 add65 (0xffff_e558) read/write r/w reset value 0 0 0 1 1 1 1 1 function 15 14 13 12 11 10 9 8 bit sy mbol add615 add614 add613 add612 add611 add610 add69 add68 read/write r/w reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit symbol add623 add622 add621 add620 add619 add618 add617 add616 read/write r/w reset value 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit symbol add631 add630 add629 add628 add627 add626 add625 add624 read/write r/w reset value 0 0 0 0 0 0 0 0 function 7 6 5 4 3 2 1 0 addreg7 bit symbol add77 add76 add75 (0xffff_e55c) read/write r/w reset value 0 0 0 1 1 1 1 1 function 15 14 13 12 11 10 9 8 bit sy mbol add71 5 add714 add713 add712 add711 add710 add79 add78 read/write r/w reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit sy mbol add72 3 add722 add721 add720 add719 add718 add717 add716 read/write r/w reset value 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit sy mbol add73 1 add730 add729 add728 add727 add726 add725 add724 read/write r/w reset value 0 0 0 0 0 0 0 0 function note: dma transfer cannot be performed to an address register. dma transfer can be performed to a data area in th e ram which contains substitution data. the rom correction function can be used when either the tx19a core processor or dmac owns the bus. tmp19a71 16-6
tmp19a71 17. flash memory this chapter describes the hardwa re configuration and operation of the flash memory contained in the tmp19a71. 17.1 overview 17.1.1 features 1) memory capacity the tmp19a71 contains 2 mbits (256 kbytes) of flash memory, which is divided into two 128-kbyte blocks. each block can be independently protected from program and erase operations. while the tx19a core processor can access the flash memory through a full 32-bit data bus, an external flash programme r can only access the flash memory through a 16-bit data bus. 2) program and erase times c hip program time (including verify): 5 seconds (typ.) chip erase time (including verify): 20 seconds (typ.) note: these program and erase times are typical val ues not including data trans fer overhead. the actual chip program and erase times depend on the programming method used. 3) programming modes the tmp19 a71 flash memory can be programmed while mounted on a user board (on-board programming mode) or by using an eprom programmer (programmer mode). ? on-board programming modes 1) user boot mode a user-created programming algorithm can be used. 2) single boot mode a toshiba-defined serial interface protocol is used. ? programmer mode a general-purpose programmer can be used. (t. b. d) 5) pro gramming method programming operations of the tmp19a71 fl ash memory are controlled by commands except for a few functions. the tmp19a71 contains a command sequencer which recognizes programming commands and automatically executes corresponding sequences of operation. this feature eliminates the need for the user to code complex program and erase sequences. the tmp19a71 provides an anti-programmer security feature for protecting the on-chip f lash memory from being read by programmi ng equipment. the tm p19a71 also allows the user to protect individual blocks of the flash memory from program or erase operations. this block protection feature is implemented by software; the hardware method (high voltage application) is not supported. the anti-programmer security feature is automatically enabled when both of the two blocks are placed under protection. when the unprotect command is executed, the flash memory is automatically erased before block protection is lifted to ensure data security. tmp19a71 17-1
tmp19a71 table 17.1.1 modified/deleted auto programming features available auto programming features modified/deleted features ? auto program ? auto chip erase ? auto block erase ? auto multi-block erase ? data polling modified: block protection is avai lable onl y under software control. deleted: erase resume/suspend mode 17.1.2 block diagram internal address bus rom controller mode setting internal signal control a ddress data flash memory column decoder/sense amp data latch address latch erase block decoder control logic command sequencer rdy/bsy output internal data bus internal control bus flash memory array 256 kb row decoder mode control figure 17.1.1 fla sh memory block diagram tmp19a71 17-2
tmp19a71 17.2 operating modes the tmp19a71 offers a total of four operating modes as shown in the table below. table 17.2.1 ope rating modes operating mode description single-chip mode normal mode user boot mode after a reset, the tx19a core processor exec utes o ut of the on-chip flash memory. single-chip mode is further divided into normal m ode in which the user applic ation executes and user boot mode which allows for re-programming of the flash memory while the tmp19a71 is installed on a printed circuit board. the user can freely define how to switch between no rmal mode and user boot mode. for example, the logic state on port 00 can be used to determine whether to put the flash memory in normal mode or user boot mode. in this case, the user must include a routi ne in the application program to test the state of that port. single boot mode after a reset, the tx19a core processor exec utes out of the on-chi p boot rom (which is a mask rom). the boot rom contains a routine to aid users in pe rforming on-board programming of the flash memory via a serial port of the tmp19a71. the serial port is connected to an external host which transfers new data according to a prescribed protocol. programmer mode this mode allows for re-programming of the flash memory with a general-purpose eprom programmer. use the prog rammer and programming adaptor recommended by toshiba. the on-chip flash memory can be programmed in one of the following three modes: user boot m ode, single boot mode and programmer mode. of these modes, user boot mode and single boot mode allow the flash memory to be programmed while the tmp19a71 is mounted on a printed circuit board. these two modes are collectively referred to as on-board programming modes. tmp19a71 17-3
tmp19a71 the logic states on the test0, p90 to p93 an d p94 (boot) pins during a reset sequence determine the mode of operation for the flash memory, as shown in table 17.2.2 . after the reset state is r eleased, p94 (boot) and p90 to p93 ca n be configured as general-purpose i/o pins. after a reset, the tx19a core processor operates in compliance with the selected mode. when p rogrammer mode is selected, however, the reset pin must be held at logic 0. the input pins listed in table 17.2.2 must remain stable once the flash memory is put in a given mode of op eration. table 17.2.2 mod es of operation input pins operating mode reset p90 p91 p92 p93 boot test0 test1 (1) single-chip mode 0 1 (note ) (note ) (note ) (note ) 1 0 0 (2) single boot mode 0 1 (note ) (note ) (note ) (note ) 0 0 0 (3) programmer mode 0 1 1 0 0 (note ) 1 0 note: don?t care. the pins must be held at 0 or 1. programmer mode on-board programming mode reset = 0 reset = 0 (2) (3) (1) single-chip mode reset a ny condition other than (3) reset = 0 normal mode user boot mode single boot mode user-defined condition parenthesized numbers indicate that the relevant pins are at the logic states shown in table 17.2.2. figure 17.2.1 mode transitions 17.2.1 reset operation to reset the tmp19a71, the reset input must be kept at logic 0 at least for 10 ms after power-up. tmp19a71 17-4
tmp19a71 17.2.2 memory maps the memory map for the tmp19a71 varies according to the mode of operation selected for the on-chip flash memory, as shown below. note: the addresses shown above are physical addresses. figure 17.2.2 tmp19a71 memory map s when the tmp19a71 is started in single boot mode, the boot rom (mask rom) is m apped to an 8-kbyte area starting from the reset vector (0x1fc0_0000), and the flash memory is mapped from 0x4000_0000. when the tmp19a71 is started in s ingle-chip mode, the flash memory is mapped from the reset vector, and the flash memory sh adow is mapped from 0x4000_0000. the following descriptions use virtua l addresses, unless otherwise noted. on-chip peripherals single-chip mode single boot mode programmer mode 0xffff_ffff 0xc000 _0000 0xffff_ffff 0xffff_bfff 0xffff_9800 0xff3f_ffff 0xff20_0000 0x0000_0000 0xff00_0000 0xbf00_0000 0xffff_ffff 0xffff_bfff 0xffff_9800 0xff3f_ffff 0xff20_0000 0xc000_0000 0xff00_0000 0xc000_0000 0x4003_ffff 0x4000_0000 0x1f c3_ffff 0x1fc0_0000 0x2000_0000 on-chip ram (10kb) (reserved) used for debugging (reserved) (reserved) (reserved) on-chip rom shadow inaccessible (512 mb) user program area maskable interrupt area exception vector area boot mrom ( kb) inaccessible (512 mb) on-chip flash rom (reserved) (reserved) (reserved) used for debugging (reserved) on-chip ram on-chip peripherals on-chip flash rom inaccessible inaccessible (512 mb) inaccessible inaccessible 0x1fc0_1fff 0x4003_ ffff 0x4000_0000 0x2000_0000 0x1fc0_0000 0x0000_0000 0xbf00_0000 0x4000_0000 0x2000_ 0000 0x0003_ffff 0x0000_0000 tmp19a71 17-5
tmp19a71 as shown in figure 17.2.3, the tmp19a71 flash memory is comprised of two 128-kbyte blocks. block 0 block 1 128kb 128kb 256kb figure 17.2.3 fla sh memory block architecture table 17.2.3 bl ock addresses based on mode setting single-chip mode single boot mode programmer mode block 0 0xbfc0_0000 to 0xbfc _fff f (shadow: 0x0000_0000 to 0x0001_ffff) 0x0000_0000 to 0x000 _f fff 0x0000_0000 to 0x0001_ffff block 1 0xbfc2_0000 to 0xbfc3_ffff (shadow: 0x0002_0000 to 0x0003_ffff) 0x0002_0000 to 0x0003_ffff 0x0002_0000 to 0x0003_ffff 17.2.3 block protection the tmp19a71 flash memory is comprised of tw o 128-kbyte blocks. to protect stored data from any program and erase operations, each block has a protect bit, which can be set by executing the block protect command sequence. blocks in protection mode are protected from even the chip erase and multi-block erase commands; these commands erase only unprotected blocks. since protection status is st ored in flash memory cells, it is retained if the chip is powered off. when both blocks are protected, the data stored in them cannot be read in programmer mode, which pr ovides a security feature (hereinafter referred to as the anti-programmer security feature). 17.2.4 security features when the tx19a core processor is active table 17.2.4 shows the security features available when the tx19a core processor is active. blka indicates block 0 (at addresses 0xbfc0_0000 to 0xbfc1_ffff), and blkb indicates block 1 (at addresses 0xbf c2_0000 to 0xbfc3_ffff). in programmer mode in which a general-purpose eprom programmer is used, the security fe atures available differ from those shown in the table below. table 17.2.4 security features of the tx19a core processor dsu function blka write protect blkb write protect off on off on off on off on use of dsu yes yes yes -- -- -- -- no blka read yes yes yes -- -- -- -- yes blkb read yes yes yes -- -- -- -- yes blka program (write) yes yes no -- -- -- -- no blkb program (write) yes no yes -- -- -- -- no blka erase yes yes -- -- -- -- no blkb erase yes no yes -- -- -- -- no chip erase yes yes*1yes*1 -- -- -- -- no blk protect yes yes yes -- -- -- -- yes blk protect yes yes yes -- -- -- yes unprotect (all blocks) yes yes yes -- -- -- -- yes id read/protect verify yes yes yes -- -- -- -- yes yes: can be used no: cannot be used --: not supported *1: the chip erase command erases only unprotected blocks. enabled disabled off off on on tmp19a71 17-6
tmp19a71 dsu (ejtag)-probe interface the dsu-probe interface is used solely for software debugging using an external dsu-probe unit. consult the dus-probe operation manual for the details on debugging using the dsu-probe. when the tmp19a71 is in dus (ejtag) mode, the on-chip flash memory provides a security feature. (1) permitting and prohibiting the use of a dsu-probe the tmp19a71 supports on-board debugging while it is installed on a printed circuit boar d. the tmp19a71 provides a feature to prohibit the use of a dsu-probe to prevent intrusive access to the flash memory. in dsu prohibit mode, a dsu-probe is denied access to the entirety of the flash memory. (2) dsu prohibit mode (disabling debugging with a dsu-probe) once program debugging is completed, write the protect command to both blocks. this turns on the anti-programmer security feature. while the flash memory is in the secure state, a dsu-probe cannot read its contents. when the chip is powered off and powered on again, the flash memory is put in dsu proh ibit mode, which disables debugging using a dsu-probe until the flash memory exits dsu prohibit mode. (3) dsu permit mode (enabling debugging with a dsu-probe) the flash memory can only be brought out of dsu prohibit mode by clearing the dsuoff b it in the seqmod to 0 and then writing a special code (0x0000_00c5) to the dsu security control (seqcnt) register. this prevents runaway software from inadvertently turning off the dsu prohibit feature. when the flash memory exits dsu prohibit mode, the dsu interface is enabled. the flash memory can be secured again by setting the dsuoff bit in the seqmod to 1 and writing 0x0000_00c5 to the seqcnt while the chip is powered. dsu security mode register 7 6 5 4 3 2 1 0 seqmod bit symbol D D D D D D D dsuoff (0xffff_e510) read/write r r r r r r r r/w reset value 0 0 0 0 0 0 0 1 function 1: dsu disabled 0: dsu enabled 15 14 13 12 11 10 9 8 bit sy mbol D D D D D D D D read/write r r r r r r r r reset value 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit sy mbol D D D D D D D D read/write r r r r r r r r reset value 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit sy mbol D D D D D D D D read/write r r r r r r r r reset value 0 0 0 0 0 0 0 0 function note 1: the setting of the dsuoff bit takes effect after the seqcnt register is set. note 2: this register must be accessed as a 32-bit quantity. bits 1 to 31 are read as 0. note 3: in the flash-version device, this register is initialized by a power-on reset. tmp19a71 17-7 note 4: this register does not support bit manipulation instructions.
tmp19a71 dsu security control register 7 6 5 4 3 2 1 0 seqcnt bit symbol D (0xffff_e514) read/write w reset value D function must be written as 0x0000_00c5. 15 14 13 12 11 10 9 8 bit sy mbol D read/write w reset value D function must be written as 0x0000_00c5. 23 22 21 20 19 18 17 16 bit symbol D read/write w reset value D function must be written as 0x0000_00c5. 31 30 29 28 27 26 25 24 bit sy mbol D read/write w reset value D function must be written as 0x0000_00c5. note 1: this register must be accessed as a 32-bit quantity. note 2: this register does not support bit manipulation instructions. (4) application example the following flowchart shows an example of how to use the security feature with a dsu-pr obe. tmp19a71 dus prohibited at power-up (in mask rom version, dsu is prohibited by reset.) dsu permission judgment routine (user-created) external port data, etc. n exit dus prohibit mode? y program seqmod and seqcnt to exit dsu prohibit mode [dsu prohibit mode] the dsu-probe cannot be used. [dsu permit mode] the dsu ?probe can be used until the chip is powered off. figure 17.2.4 using the dsu prohibit feature tmp19a71 17-8
tmp19a71 17.3 on-board programming mode on-board programming allows re-programming of the flash memory while the tmp19a71 is soldered on a printed circuit board. the tmp19a71 provides two types of on-programming mode. in single boot mode, new data comes from a serial port under control of a toshiba-provided routine in the boot rom. user boot mode allows you to create an algorithm of your own for flash memory erase and program operations. the tmp19a71 flash memory provides an anti -programm er security feature to prevent intrusive access to the flash memory while in programmer mode. this se curity feature can be enabled upon completion of on-board programming to protect rom data from being read by third parties. 17.3.1 user boot mode (single-chip mode) user boot mode allows you to create a programming algorithm of your own. user boot mode is one of the two submodes in single-chip mode; the other submode is normal mode in which the tx19a core processor executes the user app lication. to re-program the flash memory, the mode of operation must be switched from normal mode to user boot mode. the user application code must include a mode judgment routine. the user must define the conditions for mode switching, based on the logic states on i/o ports of th e tmp19a71. additionally, the user must incorporate a programming algorithm into the user application code. after user boot mode is entered, this programming algorithm is copied into the on-chip ram to re-program the flash memory. the flash memory cannot be read while it is being erased or programmed. while the flash m emory is being erased or programmed, all interrupts including nonmaskable interrupts must be disabled. once re-programming is co mplete, it is recommended to protect flash memory blocks as required from accidental corruption. the pages that follow describe the general procedures for two cases where the programming rout ine is: a) stored within the tmp19a71 flas h memory, and b) loaded from an external controller. for a detailed description of program and erase operations, see section 17.4 on-board programming and erasure. tmp19a71 17-9
tmp19a71 user boot mode (1-a) method 1: storing a programming routine in the flash memory (1) determine the conditions (e.g., pin states) required for the flash memory to enter user boot mod e and the i/o bus to be used to transfer new program code. create hardware and software accordingly. before installing the tmp19a71 on a printed circuit board, write the following program routines into a flash block using programming equipment. (a) mode judgment routine: code to determine whether or not to switch to user boot mode (b) programming routine: code to download ne w pr ogram code from a host controller and re-program the flash memory (c) copy routine: code t o copy the flash programming routine from the tmp19a71 flash memory to the tmp19a71 on-chip ram routines (a), (b) and (c) are collectively called the programming procedure. tmp19a71 flash memory ram [programming procedure] (a) mode judgment routine old application program code host controller new application program code i/o (b) programming routine (c) copy routine (2) the mode judgment routine written in one of the blocks in the flash memory determines whet her to put the tmp19a71 flash memory in user boot mode. if the specified conditions are met, the flash memory enters user boot mode. tmp19a71 flash memory ram [programming procedure] old application program code host controller new application program code i/o (a) mode judgment routine (b) programming routine (c) copy routine conditions for entering user boot mode (defined by the user) 0 1 rese t tmp19a71 17-10
tmp19a71 (3) once user boot mode is entered, execute the copy routine to copy the flash programming routine to the tmp19a71 on-chip ram. tmp19a71 flash memory ram [programming procedure] (a) mode judgment routine old application program code host controller new application program code i/o (b) programming routine (c) copy routine (b) programming routine (4) jump program execution to the flash programming routine in the on-chip ram to erase the flash block containing the old application program code. all interrupts including reset and nmi must be disabled until new application pr ogram code has been written to the flash memory. tmp19a71 flash memory ram [programming procedure] (a) mode judgment routine host controller new application program code i/o (b) programming routine (c) copy routine (erased) (b) ` (b) programming routine tmp19a71 17-11
tmp19a71 (5) continue executing the flash programming routine to download new application program code from the host controller and program it into the erased flash block. once programming is complete, turn on the protection of that flash block. tmp19a71 flash memory ram [programming procedure] (a) mode judgment routine new application program code host controller new application program code i/o (b) programming routine (c) copy routine (b) ` (b) programming routine (6) drive the reset pin low to reset the tmp19a71 and enter normal mode or jump to an arbitrary address to execute the new user application program. tmp19a71 flash memory ram [programming procedure] (a) mode judgment routine new application program code host controller i/o (b) programming routine (c) copy routine set to normal mode 0 1 rese t tmp19a71 17-12
tmp19a71 (1-b) method 2: transferring a progra mming routine from an external host (1) determine the conditions (e.g., pin states) required for the flash memory to enter user boot mode and the i/o bus to be used to transfer new program code. create hardware and software accordingly. before installing the tmp19a71 on a printed circuit board, write the following program routines into a flash block using programming equipment. (a) mode judgment routine: code to determine whether or not to switch to user boot mode (b) transfer routine: code to download new program code from a host controller routines (a) and (b) are collectively called the programming procedure. also, prepare the following routine on the host controller. (c) programming routine: code to re-program the flash memory tmp19a71 flash memory ram [programming procedure] (a) mode judgment routine old application program code host controller new application program code i/o (b) transfer routine (c) programming routine (2) the mode judgment routine written in one of the blocks in the flash memory determines whether to put the tmp19a71 flash memory in user boot mode. if the specified conditions are met, the flash memory enters user boot mode. tmp19a71 host controller i/o (c) programming routine new application program code 0 1 reset conditions for entering user bo ot mode (defined by the user) ram flash memory old application program code [programming procedure] (b) transfer routine (a) mode judgment routine tmp19a71 17-13
tmp19a71 (3) once user boot mode is entered, execut e the transfer routine to download the flash programming routine from the host controller to the tmp19a71 on-chip ram. tmp19a71 flash memory ram [programming procedure] (a) mode judgment routine old application program code host controller new application program code i/o (b) transfer routine (c) programming routine (c) programming routine (4) jump program execution to the flash programming routine in the on-chip ram to erase a flash block containing the old application program code. all interrupts including reset and nmi must be disabled until new application program code has been written to the flash memory. tmp19a71 flash memory ram [programming procedure] (a) mode judgment routine host controller new application program code i/o (b) transfer routine (erased) (c) programming routine (c) programming routine tmp19a71 17-14
tmp19a71 (5) continue executing the flash programming routine to download new application program code and program it into the erased flash bloc k. once programming is complete, turn on the protection on that flash block. tmp19a71 flash memory ram [programming procedure] (a) mode judgment routine new application program code host controller new application program code i/o (b) transfer routine (c) programming routine (c) programming routine (6) driv e the reset pin low to reset the tmp19a71 and enter normal mode or jump to an arbitrary address to execute the new user application program. tmp19a71 host controller i/o 0 1 reset set to normal mode ram flash memory new application program code [programming procedure] (b) transfer routine (a) mode judgment routine tmp19a71 17-15
tmp19a71 17.3.2 single boot mode in single boot mode, the flash memory can be re-programmed by using a program contained in the tmp19a71 on-chip boot rom. this boot rom is a masked rom. when single boot mode is selected upon reset, the boot rom is mapped to the address region including the interrupt vector table while the flash memory is mapped to an address region different from it (see figure 17.2.2 ). single boot mode allows for serial programming of the flash memory. the sio (sio2) of the tmp19a71 is connect ed to an external host controller. via this serial link, a programming routine is downloaded from the host controller to the tmp19a71 on-chip ram. then, the flash memory is re-programmed by executing the programming routine. the host sends out both commands and programming data to re-program the flash memory. communications between the sio2 and the host must follow the prescribed protocol described later . to secure the contents of the flash memory, password verification is performed before a programming routine is downloaded into the on-chip ram. if password verification fails, the transfer of a programming routine itself is aborted. all interrupts including nonmaskable interrupts must be disabled while the boot program is executed. once re-programming is comple te , it is recommended to protect flash memory blocks as required from accidental corruption during su bsequent operation in single-chip (normal) mode. for a detailed description of erase and program operations, see section 17.4 on-board programming and erasure. tmp19a71 17-16
tmp19a71 single boot mode (2-a) general procedure: using a programming algorithm in the on-chip boot rom (1) the flash block containing the older version of the program code need not be erased before executing the programming routine. since a programming routine and programming data are transferred via the uart2 or sio2, the uart 2 or sio2 pins must be connected to a host controller. prepare a programming routine on the host controller. (the sio2 is used here.) tmp19a71 flash memory ram old application program c ode (or erased state) host controller new application program code i/o (a) programming routine boot rom sio2 (2) reset the tmp19a71 with the mode setting pins held at appropriate logic values for re-booting from the on-chip boot rom. in single boot mode, the 12-byte password transferred from the host controller is fi rst compared to the password stored in the user application program in the flash memory. (if the flash memory has already been erased, password verification is performed using the erased data.) tmp19a71 host controller i/o 0 1 reset (a) programming routine sio2 boot rom old application program code (or erased state) ram flash memory new application program c ode tmp19a71 17-17
tmp19a71 (3) if password verification is successful, the boot program loads the programming routine from the host controller into the on-chip ram. the programming routine must be stored in the address range of 0xffff_9800 to 0xffff_afff. tmp19a71 flash memory ram old application program c ode (or erased state) host controller new application program code i/o (a) programming routine boot rom sio2 (a) programming routine (4) the tx19a core processor jumps to the programming routine in the on-chip ram to erase the flash block containing the old application program code. (the block erase or chip erase command may be used.) tmp19a71 flash memory ram host controller new application program code i/o erased (a) programming routine sio2 boot rom (a) programming routine tmp19a71 17-18
tmp19a71 (5) next, the programming routine loads new application program code from the host controller into the erased flash block. once programming is complete, the flash block is placed under protection. in the example below, new program code comes from the same host controller via the same sio chann el as for the programming routine. howeve r, once the programming routine has begun to execute, the transfer path and the source of the transfer can be changed as desired. create board hardware and a programming routine to suit your particular needs. note: the boot rom provides no vector area for all maskable interrupts and nmi. while the programming routine is executed, no exception should be allowed to occur. tmp19a71 flash memory ram new application program c ode host controller new application program code i/o (a) programming routine sio2 boot rom (a) programming routine (6) when the flash memory has been programmed, power off the board and disconnect the cable connecting the host controller. then, turn on the power again and re-boot the tmp19a71 in single-chip mode (normal mode) to execute the new application program. tmp19a71 host controller 0 1 reset set to single-chip mode (no rmal mode) sio2 boot rom ram new application program c ode flash memory tmp19a71 17-19
tmp19a71 (1) connection examples in single boot mode in single boot mode, serial transfer is used to re-program the flash memory while the tmp19 a71 is installed on a printed circuit board. in this mode, the sio (channel 2) of the tmp19a71 is connected to a host controller (programming tool). the host controller issues commands to the target board to perform programming operations. figure 17.3.1 and figure 17.3.2 show examples of host-to-target connection. target board tx2 (p86) rx2 (p85) dvcc2 vcc pc rs232c rom mode control vcc vcc reg. a c 100v host controller dvss reset tmode mcu mode control rx vss tx reset boot mode selection logic boot ram reg. nmi tmp19a71 figure 17.3.1 exam ple of connection between a host controller and a target board in single boot mode (when the sio2 is configured for uart mode) tmp19a71 17-20
tmp19a71 target board tx2 (p86) rx2 (p85) dvcc2 vcc pc rs232c rom mode control vcc vcc reg. a c 100v host controller dvss reset tmode mcu mode control rx vss tx reset boot ram reg. nmi p80 tbus y sclk2 (p87) tck boot mode selection logic tmp19a71 figure 17.3.2 exam ple of connection between a host controll er and a target board in single boot mode (when the sio2 is configured for i/o interface mode) tmp19a71 17-21
tmp19a71 ( 2) configuring for single boot mode to perform on-board programming, boot up the tmp19a71 in single boot mode, as shown below . test0 = 0 boot = 0 reset = 0 1 while the reset pin is held at logic 0, set the test0 and bo ot (p94) pins at the logic values shown above. then, driving the reset pin high boots up the tmp19a71 in single boot mode. (3) memory map figure 17.3.3 shows a comparison of the memory maps in single-chip (normal) mode and si ngle boot mode. in single boot mode, the on-chip flash memory is mapped to physical addresses 0x4000_0000 through 0x400f_ffff and virtual addresses 0x0000_0000 through 0x000f_ffff. the on-chip boot rom (mask rom) is mapped to physical addresses 0x1fc0_0000 through 0x1fc0_1fff. normal mode single boot mode 0x1fc0_1fff 0x1fc0_0000 0x0000_0000 0xffff_ffff 0xffff_bfff 0xffff_9800 0xff3f_ffff 0xff20_0000 0xc000_0000 0x400f_ffff 0x4000_0000 0x1fc3_ffff 0x1fc0_0400 0x1fc0_0000 0x2000_0000 0xff00_0000 0xbf00_0000 0xffff_ffff 0xffff_bfff 0xffff_9800 0xff3f_ffff 0xff20_0000 0xc000_0000 0x4003_ffff 0x4000_0000 0x2000_0000 0xff00_0000 0xbf00_0000 on-chip peripherals 0x0000_0000 on-chip ram (10kb) (reserved) used for debugging (reserved) (reserved) (reserved) on-chip rom shadow inaccessible (512 mb) user program area maskable interrupt area exception vector area internal rom (reserved) boot mrom (6 kb) inaccesible (512 mb) on-chip flash rom (reserved) used for debugging (reserved) (reserved) on-chip ram (10kb) on-chip peripherals note: the addresses shown above are physical addresses. figure 17.3.3 memory maps for normal and single boot modes tmp19a71 17-22
tmp19a71 (4) interface specifications in single boot mode, an sio channel is used for communications with a programming controller. both uart (asynchronous) and i/ o interface (synchronous) modes are supported. to perform on-board programming, the interface specifications shown below must also be set on the controller side. uart mode com munications channel : uart2 transfer mode : uart (asynchronous) mode, full-duplex data length : 8 bits parity bit : none stop bit : 1 bit baud rate : up to 437.5 kbps (at 56 hz) up to 312.5 kbps (at 40 hz) others : lsb first, sc2mod2.wbuf=0 ? ? i/o interface mode commun ications channel : sio2 transfer mode : i/o interface mode, half-duplex synchronization signal (sclk2) sclk input mode (sc2cr = 0x01) handshaking signal : p80 configured as an output baud rate : up to 3 mbps (at 56 hz) up to 2.5 mbps (at 40 mhz) others : lsb first, sc2mod2.wbuf = 0 table 17.3.1 re quired pin connections interface pin uart mode i/o interface mode dvcc3 required required power supply pins dvss required required mode setting pin boot required required reset pin reset required required tx2 required required rx2 required required sclk2 not required required (input mode) communications pins p80 not required required (output mode) (5) data transfer format table 17.3.2 lists the commands to be issued fr om the host controller to the target board in single boot mode. tables 17.3.3 to 17.3.5 illustrate the sequence of two-way communications that should occur in response to each command. table 17.3.2 si ngle boot mode commands code command 0x10 ram transfe r 0x20 show flash memory sum 0x30 show product information tmp19a71 17-23
tmp19a71 table 17.3.3 transfer format for the ram transfer command byte data transferred from the controller to the tmp19a71 baud rate data transferred from the tmp19a71 to the cont roller boot rom 1st byte serial operation mode and baud rate for uart mode 0x86 for i/o interface mode (note 2) 0x30 specified baud rate (note 1) ? 2nd b yte ? ack for the serial operation mode byte for uart mode normal acknowledge 0x86 (the boot program aborts if the baud rate cannot be set cor rectly.) for i/o interface mode normal acknowledge 0x30 3rd byte command code (0x10 ) ? 4th b yte ? ack for the command code byte (note 3) normal acknowledge 0x30 negative acknowledge 0x11 communication error 0x18 5th byte to 16th b yte password sequence (12 bytes) (0x0000_0474 to 0x0000_047f) ? 17th byte checksum value for 5th to 16th bytes ( note 4) ? 18th b yte ? ack for the checksum byte (note 3) normal acknowledge 0x10 negative acknowledge 0x11 communication error 0x18 19th byte ram storage start address 31 to 24 (note 5) ? 20th byte ram storage start address 23 to 16 (note 5) ? 21st byte ram storage start address 15 to 8 (note 5) ? 22nd byte ram storage start address 7 to 0 (note 5) ? 23rd byte ram storage byte count 15 to 8 (note 5) ? 24th byte ram storage byte count 7 to 0 (note 5) ? 25th byte checksum value for 19th to 24th bytes (note 4) ? 26th b yte ? ack for the checksum byte (note 3) normal acknowledge 0x10 negative acknowledge 0x11 communication error 0x18 27th b yte to mth byte ram storage data ? (m + 1)th byte checksum value for 27th to mth bytes (note 4) ? (m + 2)th byte ? ack for the checksum byte (note 3) normal acknowledge 0x10 negative acknowledge 0x11 communication error 0x18 ram (m + 3)th byte ? jump to ram storage start address note 1: in i/o interface mode, the baud rate for transferring the 1st and 2nd bytes must be 1/16 of the specified baud rate. note 2: in i/o interface mode, a waveform that allows the serial operation mode to be determined should be generated. note 3: in case of any negative acknowledgment, the boot program returns to a state in which it waits for a command code (3rd b yte). in i/o interface mode, no acknowledgment is returned for a communicaion error. note 4: the checksum value is obtained by adding all the bytes of transmitted data together, dropping the carries, and taking t he two?s complement of the total sum. note 5: the 19th to 24th bytes must be within the ram address range 0xffff_9800 to 0xffff_afff. tmp19a71 17-24
tmp19a71 table 17.3.4 transfer format for the show flash memory sum command byte data transferred from the controller to the tmp19a71 baud rate data transferred from the tmp19a71 to the cont roller boot rom 1st byte serial operation mode and baud rate for uart mode 0x86 for i/o interface mode (note 2) 0x30 specified baud rate (note 1) ? 2nd b yte ? ack for the serial operation mode byte for uart mode normal acknowledge 0x86 (the boot program aborts if the baud rate cannot be set cor rectly.) for i/o interface mode normal acknowledge 0x30 3rd byte command code (0x20 ) ? 4th b yte ? ack for the command code byte (note 3) normal acknowledge 0x20 negative acknowledge 0x21 communication error 0x28 5th b yte ? sum (upper byte) 6th b yte ? sum (lower byte) 7th b yte ? checksum value for 5th and 6th bytes (note 4) 8th byte (wait for the next command code.) ? note 1: in i/o interface mode, the baud rate for transferring the 1st and 2nd bytes must be 1/16 of the specified baud rate. note 2: in i/o interface mode, a waveform that allows the serial operation mode to be determined should be generated. note 3: in case of any negative acknowledgment, the boot program returns to a state in which it waits for a command code (3rd b yte). in i/o interface mode, no acknowledgment is returned for a communication error. note 4: the checksum value is obtained by adding all the bytes of transmitted data together, dropping the carries, and taking t he two?s complement of the total sum. note 5: the sum value is the lower 16 bits of a value obtained by adding all the bytes in the flash memory together. sum (high) = sum[ 15 : 8 ], sum (low) = sum[ 7 : 0 ] tmp19a71 17-25
tmp19a71 table 17.3.5 transfer format for the show product information command (1/2) byte data transferred from the controller to the tmp19a71 baud rate data transferred from the tmp19a71 to the cont roller boot rom 1st byte serial operation mode and baud rate for uart mode 0x86 for i/o interface mode (note 2) 0x30 specified baud rate (note 1 ) ? 2nd b yte ? ack for the serial operation mode byte for uart mode normal acknowledge 0x86 (the boot program aborts if the baud rate cannot be set correctl y.) for i/o interface mode normal acknowledge 0x30 3rd byte command code (0x30 ) ? 4th b yte ? ack for the command code byte (note 3) normal acknowledge 0x30 negative acknowledge 0x31 communication error 0x38 5th b yte ? flash memory data (at address 0x0000_0470) 6th b yte ? flash memory data (at address 0x0000_0471) 7th b yte ? flash memory data (at address 0x0000_0472) 8th b yte ? flash memory data (at address 0x0000_0473) 9th b yte to 20th byte ? product name (12-byte ascii code) ?tx19a71fy? + 0x20, 0x20, 0x20 from the 9th byte 21st b yte to 24th byte ? password comparison start address (4 bytes) 0x74, 0x04, 0x00, 0x00 from the 21st byte 25th b yte to 28th byte ? ram start address (4 bytes) 0x00,0x98, 0xff, 0xff from the 25th byte 29th b yte to 32nd byte ? dummy data (4 bytes) 0xff, 0xa7, 0xff, 0xff from the 29th byte 33rd b yte to 36th byte ? ram end address (4 bytes) 0xff, 0xbf, 0xff, 0xff from the 33rd byte 37th b yte to 40th byte ? dummy data (4 bytes) 0x00, 0xa8, 0xff, 0xff from the 37th byte 41st b yte to 44th byte ? dummy data (4 bytes) 0xff, 0xaf, 0xff, 0xff from the 41st byte 45th b yte to 46th byte ? fuse information (2 bytes) 0x00, 0x00 from the 45th byte 47th b yte to 50th byte ? flash memory start address (4 bytes) 0x00, 0x00, 0x00, 0x00 from the 47th byte 51st b yte to 54th byte ? flash memory end address (4 bytes) 0xff, 0xff, 0x03, 0x00 from the 51st byte 55th b yte to 56th byte ? flash memory block count (2 bytes) 0x02, 0x00 from the 55th byte 57th b yte to 60th byte ? start address of a group of the same-size flash blocks ( 4 bytes) 0x00, 0x00, 0x00, 0x00 from the 57th byte tmp19a71 17-26
tmp19a71 table 17.3.5 transfer format for the show device information command (2/2) byte data transferred from the controller to the tmp19a71 baud rate data transferred from the tmp19a71 to the cont roller root rom 61st byte to 64th byte ? size (in half words) of the same-size flash blocks (4 b ytes) 0x00, 0x00, 0x01, 0x00 from the 61st byte 65th b yte ? number of flash blocks of the same size (1 byte) 0x02 66th b yte ? checksum value for the 5th to 65th bytes (note 4) 67th byte (wait for the next command code.) ? note 1: in i/o interface mode, the baud rate for transferring the 1st and 2nd bytes must be 1/16 of the specified baud rate. note 2: in i/o interface mode, a waveform that allows the serial operation mode to be determined should be generated. note 3: in case of any negative acknowledgment, the boot program returns to a state in which it waits for a command code (3rd b yte). in i/o interface mode, no acknowledgment is returned for a communication error. note 4: the checksum value is obtained by adding all the bytes of transmitted data together, dropping the carries, and taking t he t wo?s complement of the total sum. tmp19a71 17-27
tmp19a71 (6) overview of the boot program commands when single boot mode is selected, the boot program is automatically executed on startup. t he boot program offers the following three commands (each command is explained in detail in the subsections that follow): 1. r am transfer command the ram transfer command stores program code transferred from a host controller to the on-chip ram and executes the program once the transfer is successfully completed. the maximum program size is 6 kb ytes (0xffff_9800 to 0xffff_afff). the ram transfer command enables the user to control on-board programming of the flash memory in a unique manner by providing the means for downloading a user-created programming routine. the programming rout ine must use the flash memory command sequences described in section 17.4 on -board programming and erasure. before initiating a transfer, the ram transfer command checks a password sequence coming from the controller against the password stored in the flash memory. if they do not match, the ram transfer command aborts. 2. sho w flash memory sum command the show flash memory sum command adds the contents of the flash memory and returns the lower 16 bits of the result. the boot program does not provide a command to read out the contents of the flash memory. instead, the show flash memory sum command can be used for soft ware revision management. 3. show product information command t he show product information command provides product information, such as the product name and on-chip memory configurat ion, stored at addresses 0x0000_0470 to 0x0000_0473 in the flash memory. in addition to the show flash memory sum command, this command can be used for so ftware revision management. tmp19a71 17-28
tmp19a71 1) ram transfer command (see table 17.3.3 ) 1. the 1st byte specifies which one of the two serial operation modes is used. for a de tailed description of how the serial operation mode is determined, see subsection 5) determination of a serial operation mode. if it is determined as uart mode, the boot program then checks if the sio2 is programmable to the baud rate at which the 1st byte was transferred. the 1st byte is transferred with receive operation disabled (sc2mod.rxe = 0). ? t o communicate in uart mode the controller sends 86h to the target bo ard in uart data format at the desired baud rate. if the serial operation mode is determined as uart, then the boot program checks if the sio2 can be programmed to the baud rate at which the 1st byte was received. the time (number of instruction execution cycles) required for this operation varies with the operating frequency and baud rate used. if the desired baud rate cannot be used, the boot program aborts, disabling any subsequent communication. in this case, a reset is required. if necessary, the controller should set a time limit for transferring the 2nd byte as appropriate to the baud rate used. ? t o communicate in i/o interface mode the controller sends the 1st byte to the ta rget board to gen erate a waveform that allows the serial operation mode to be determined as i/o interface mode. (for details, see subsection 5) determination of a serial operation mode.) when the boot program determines that communicati ons can be performed in i/o interface mode at the desired baud rate, the handshak e pin is driven high. if the high level is not detected on the handshake pin within the expected time period, this indicates that the boot program has aborted after determining that the sio2 is not programmable to the desired baud rate. in this case, a reset is required. the command sequence must be started again from the 1st byte at another baud rate. in i/o interface mode, the tx19a core processor sees the serial receive pin as if it wer e a general-purpose input port and monitors its logic transitions. if the baud rate of incoming data is high or the chip?s operating frequency is high, the tx19a core processor may not be able to keep up with the speed of logic transitions. to prevent such situations, the 1st and 2nd bytes must be transferred at 1/16 of the desired baud rate; then the boot program calculates 16 times that as the desired baud rate. at this time, the transmission of one byte should be completed before an overflow occurs in the tmrb0 (see figure 17.3.6). when the serial operation mode is determ ined as i/o interface mode, the sio2 is configured for sclk in put mode. beginn ing with the 3rd byte, the controller must ensure that the ac timing restrict ions are satisfied at the selected baud rate. in i/o interface mode, the boot pr ogram does not check the receive error flag; thus there is no such thing as error acknowledge (bit 3) (18h). 2. the 2nd byte, transmitted from the target b oard to the controller, is an acknowledge response to the 1st byte. the boot program echoes back the first byte: 86h for uart mode and 30h for i/o interface mode. ? uart mode if the sio2 can be programmed to the baud rate at which the 1st byte was tmp19a71 17-29
tmp19a71 transferred, the boot program programs the br2cr and br2add registers and sends back 86h to the controller as an acknowledge. if the sio2 is not programmable at that baud rate, the boot program simply aborts with no error indication. following the 1st byte, the controller should allow for a time-out period. if it does not receive 86h within the allotted time-out period, the controller should give up the communication. the boot program sets the rxe bit in the sc2mod to 1 to enable reception be fore loading the transmit buffer with 86h. ? i/o inter face mode the boot program programs the sc2mod and sc2cr registers to configure the sio2 in i/o interface mode and writes 30h to the sc2buf. then, the sio2 waits for the sclk2 signal to come from the controller. following the transmission of the 1st byte, the controller must wait for the rising edge of the handshaking pin before sending the sclk clock. this must be done at 1/16 of the desired baud rate. if the controller receives 30h as the 2nd byte, this should be taken as the go-ahead. the controller must then delive r the 3rd byte to the target board at a rate equal to the desired baud rate. the boot program sets the sc2mod.rxe bit to 1 before 30h is written to the transm it buffer. in i/o interface mode, receive errors are not checked. 3. the 3rd byte, which the target board receives from the controller, is a command. the code for the ram transfer command is 10h. 4. the 4th byte, transmitted from the target board t o the controller, is an acknowledge response to the 3rd byte. before sending back the acknowledge response, the boot program checks for a receive error. if there was a receive error, the boot program transmits x8h and returns to the state in which it waits for a command again. in this case, the upper four bits of the acknowledge response are undefined?they hold the same values as the upper four bits of the preceding command. if the 3rd byte is equa l to an y of the command codes listed in table 17.3.2 , the boot pro gram echoes it back to the controller. when the ram transfer command was received, the boot program echoes back a value of 10h and then branches to the ram transfer routine. once this branch is taken, a password check is done. password checking is detailed later in this subsection. if the 3rd byte is not a valid command, the boot program sends back 11h to the co ntroller to indicate a command error and returns to the state in which it waits for a command. in this case, the upper four bits of the response are undefined?they hold the same values as the upper four bits of the preceding command. 5. the 5th to 16th bytes, which the target board receives from the controller, are a 1 2-byte password. the 5th byte is compared to the contents of address 0x0000_0474 in the flash memory; the 6th byte is compared to the contents of address 0x0000_0475 in the flash memory; likewi se, the 16th byte is compared to the contents of address 0x0000_047f in the flash memory. 6. the 17th byte is a checksum value for the password sequence (5th to 16th bytes). to calcu late the checksum value for the 12-byte password, add the 12 bytes together, drop the carries and take the two?s complement of the total sum. transmit this tmp19a71 17-30
tmp19a71 checksum value from the controller to the target board. the checksum calculation is described in detail later in this section. 7. the 18 th byte, transmitted from the target board to the controller, is an acknowledge response to the 5th to 17th bytes. first, the ram transfer routine checks for a receive error in the 5th to 17th bytes. if there was a receive error, the boot program sends back 18h and returns to the state in which it waits for a command (i.e., 3rd byte) again. in this case, the upper four bits of the acknowledge response are the same as those of the preceding command (i.e., all 1s). next, the ram transfer routine performs the checksum operation to ensure data integrity. adding the 5th to 17th bytes together must result in zero (with the carries dropped). if it is not zero, the ram transfer routine sends back 11h to the controller to indicate a checksum error and returns to the state in which it waits for a command (i.e., the 3rd byte) again. finally, the ram transfer routine examines the result of the password check. if a password error is determined, the ram transfer routine sends back 11h to the controller and returns to the state in which it waits for a command (i.e., the 3rd byte) again. for data sequences that can be used as a password, see subsection 6) password. when all the above checks have been successful, the ram transfer routine returns a norm al acknowledge response (10h) to the controller. 8. the 19th to 22nd bytes, which the target board receives from the controller, indicate the start ad dress of the ram region where subsequent data should be stored. the 19th byte corresponds to bits 31 to 24 of the address, and the 22nd byte corresponds to bits 7 to 0 of the address. 9. the 23rd and 24th bytes, which the target board receives from the controller, ind icate the number of bytes that will be transferred from the controller to be stored in the ram. the 23rd byte corresponds to bits 15 to 8 of the transfer byte count, and the 24th byte corresponds to bits 7 to 0 of the transfer byte count. 10. the 25th byte is a checksum value for the 19th to 24th bytes. to calculate the checksum value, add all these bytes together, drop the carries and take the two?s complement of the total sum. transmit this checksum value from the controller to the target board. the checksum calculatio n is described later in this section. 11. the 26th byte, transmitted fr om the targ et board from the controller, is an acknowledge response to the 19th to 25th bytes. first, the ram transfer routine checks for a receive error in the 19th to 25t h bytes. if there was a receive error, the ram transfer routine sends back 18h and retu rns to the state in which it waits for a command (i.e., the 3rd byte). in this case , the upper four bits of the acknowledge response are the same as those of the preceding command (i.e., all 1s). next, the ram transfer routine performs the checksum operation to ensure data integrity. adding the 19th to 25th bytes together must result in zero (with the tmp19a71 17-31
tmp19a71 carries dropped). if it is not zero, the ram transfer routine sends back 11h to the controller to indicate a checksum error and returns to the state in which it waits for a command (i.e., the 3rd byte). ? the ram storage addresses must be within the range of 0xffff_9800 to 0xffff_afff. although the boot program does not perform address checks, ram transfer may not be performed properly if other ram address locations are specified as they are used in the program. whe n the above checks have been successful, the ram transfer routine returns a normal acknowledge response (10h) to the controller. 12. the 27th to m?th bytes from the controller are stored in the on-chip ram of the tmp19 a71. storage begins at the address specified by the 19th to 22nd bytes and continues for the number of bytes specified by the 23rd and 24th bytes. 13. the (m + 1) th byte is a checksum value. to calculate the checksum value, add the 27th to m?th bytes together, drop the carri es and take the two?s complement of the total sum. transmit this checksum value from the controller to the target board. the checksum calculation is described in detail later in this section. 14. the (m + 2 )th byte is an acknowledge response to the 27th to (m+1)th bytes. first, the ram transfer routine checks for a receiv e error in the 27th to (m+1)th bytes. if there was a receive error, the ram transfer routine sends back 18h and returns to the state in which it waits for a command (i.e., the 3rd byte) again. in this case, the upper four bits of the acknowledge response are the same as those of the preceding command (i.e., all 1s). next, the ram transfer routine performs the checksum operation to ensure data integrity. adding the 27th to (m+1)th bytes together must result in zero (with carries dropped). if it is not zero, the ram transfer routine sends back 11h to the controller to indicate a checksum error and returns to the state in which it waits for a command (i.e., the 3rd byte) again. if all the above checks are successful, the ram transfer routine returns a normal acknowledge response (10h) to the controller. 15. if the (m + 2)th byt e was a normal acknowledge response, a branch is made to the address specified by the 19th to 22nd bytes in 32-bit isa mode. tmp19a71 17-32
tmp19a71 2) show flash memory sum command (see table 17.3.4 ) 1. the processing of the 1st and 2nd bytes are the same as for the ram transfer co mmand. 2. the 3rd byte, which the target board receives from the controller, is a command. the code for the show flash me mory sum command is 20h. 3. the 4th byte, transmitted from the target board t o the controller, is an acknowledge response to the 3rd byte. the processing of the 4th byte is the same as for the ram transfer command except that the command code is 20h. 4. the show flash memory sum routine adds all the bytes of the flash memory togeth er. the 5th to 6th bytes, transmitted from the target board to the controller, indicate the upper and lower bytes of this total sum, respectively. the sum calculation is described in detail later in this section. 5. the 7th byte is a checksum value for the 5th and 6th bytes. to calculate the checksum va lue, add the 5th and 6th bytes together, drop the carry and take the two?s complement of the sum. transmit this checksum value from the controller to the target board. 6. the 8th byte is the next command code. tmp19a71 17-33
tmp19a71 3) show product information command (see table 17.3.5 ) 1. the processing of the 1st and 2nd bytes are the same as for the ram transfer co mmand. 2. the 3rd byte, which the target board receives from the controller, is a command. the code for the show product in formation command is 30h. 3. the 4th byte, transmitted from the target board t o the controller, is an acknowledge response to the 3rd byte. the processing of the 4th byte is the same as for the ram transfer command except that the command data is 30h. 4. the 5th to 8th bytes, transmitted from the target board to the controller, are the data read from addresses 0x0000_0470 to 0x0000_0473 in the flash memory. software revision management is possible by storing software in formation such as an id in these locations. 5. the 9th to 20th bytes, transmitted from th e target board to the controller, indicate the product name, which is ?tx19a71fy? in ascii code followed by 20h, 20h, and 20h (12 bytes). 6. the 21st to 24th bytes, transmitted from the target board to th e controller, indicate the start address of the flash memory area containing the password (74h, 04h, 00h , 00h ). 7. the 25th to 28th bytes, transmitted from the target board to the controller, indicate the start a ddress of the on-chip ram (00h, 98h, ffh, ffh). 8. the 29th to 32nd bytes, transmitted from the tar get board to the controller, are dummy data (ffh, a7h, ffh, ffh). 9. the 33rd to 36th bytes, transmitted from th e targ et board to the controller, indicate the end address of the on-chip ram (ffh, ffh, bfh, ffh). 10. the 3 7th to 40th bytes, transmitted from the target board to the controller, are 00h, a8, ffh and ffh. the 41st to 44th bytes, transmitted from th e target board to the controller, are ffh, afh, ffh and ffh. 11. the 45th and 46th bytes, transmitted from the target board to the controller, indicate whet her the security and protect bits are available and whether the flash memory is divided into blocks. bit 0 indicates the presen ce or absence of the security bit; it is 0 if the security bit is available. bit 1 indicates the presence or absence of the protect bits; it is 0 if the protect bits are available. if bit 2 is 0, it indicates that the flash memory is divided into blocks. the remaining bits are undefined. the 45th and 46th bytes are 00h, 00h. 12. the 47th to 50th bytes, transmitted from the target board to the controller, indicate the start a ddress of the on-chip flash memory (00h, 00h, 00h, 00h). tmp19a71 17-34
tmp19a71 13. the 51st to 54th bytes, transmitted from the target board to the controller, indicate the end address of the on-chip fl ash memory (ffh, ffh, 03h, 00h). 14. the 55th and 56th bytes, transmitted from the target board to the controller, indicate the numb er of flash blocks available (02h, 00h). 15. the 57th to 92nd bytes, transmitted from the target board to the controller, contain informat ion about the flash blocks. flash bl ocks of the same size are treated as a group. information about the flash blocks in dicate the start address of a group, the size of the blocks in that group (in half words) and the number of the blocks in that group. the 57th t o 65th bytes are the information about 128-kbyte blocks (block 0 and block 1). see table 17.3.5 for the values of bytes transmitted. 16. the 66th byte, transmitted from the target b oard to the controller, is a checksum value for the 5th to 65th bytes. the checksum value is calculated by adding all these bytes together, dropping the carries and taking the two?s complement of the total sum. 17. the 67th byte is the next command code. tmp19a71 17-35
tmp19a71 4) acknowledge responses the boot program returns to the controller specific codes to notify processing states. table 17.3.6 to table 17.3.8 show the values of possible acknowledge responses to the received data. t he upper four bits of the acknowledge response are equal to those of the command being executed. bit 3 of the code indicates a receive error. bit 0 indicates an invalid command error, a checksum error or a password error. bit 1 and bit 2 are always 0. receive error checking is not performed in i/o interface mode. table 17.3.6 a ck response to the serial operation mode bytes return value meaning 0x86 the sio can be configured to operate in uart mode. (note) 0x30 the sio can be configured to operate in i/o interface mode. note: if the serial operation mode is determined as uart, the boot program checks if the sio can be programmed to the baud rate at which the operation mode byte was transferred. if the baud rate is not possible, the boot program aborts without sendig back any response. table 17.3.7 a ck response to the command byte return value meaning 0xn8 (note) a receive error occurred while a command code was being received. 0xn1 (note) an undefined command code was received. (reception was completed normally.) 0x10 the ram transfer command was received. 0x20 the show flash memory sum command was received. 0x30 the show product information command was received. note: the four high-order bits of the ack response are the same as those of the preceding command code. table 17.3.8 a ck response to the checksum byte return value meaning 0xn8 (note) a receive error occurred. 0xn1 (note) a checksum or password error occurred. 0xn0 (note) the checksum was correct. note: the four high-order bits of the ack response are the four high-order bits of the preceding command code. they are 1 if a password error occurred. tmp19a71 17-36
tmp19a71 5) determination of a serial operation mode the first byte from the controller determines the serial operation mode. to use uart mode for com munications between the controller and the target board, the controller must first send a value of 86h at a desired baud rate to the target board. to use i/o interface mode, the controller must send the first byte with a wave form satisfying tab > tc d (30h is sent here) at 1/16 of the desired baud rate. figure 17.3.4 shows the waveforms for the first byte. bit 7 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 start stop point a point d point b point c figure 17.3.4 s erial operation mode byte after the reset state is released, the boot prog ram monitors the first serial byte from the controller with the sio reception disabled, and calculates the intervals of tab, tac and tad shown in figure 17.3.4 . figure 17.3.5 shows a flowchart describing th e steps to determine the intervals of tab, tac and tad. as shown in th e flowchart, the boot program captures timer counts each time a logic transition occurs in th e first serial byte. consequently, the calculated tab, tac and tad intervals are bound to have slight errors. if the transfer goes at a high baud rate, the tx19a core processor might not be able to keep up with the speed of logic transitions at the serial receive pin. in particular, i/o interface mode is more prone to this problem since its baud rate is generally much higher than th at for uart mode. to avoid such a situation, the controller should send the first serial byte at 1/16 of the desired baud rate. the flowchart in figure 17.3.6 shows how the boot program distinguishes between uart and i/o interfac e modes. if the length of tab is equal to or less than the length of tcd, the serial operation mode is determined as uart mode. if the length of tab is greater than tcd, the serial operation mode is determined as i/o interface mode. bear in mind that if the baud rate is too high or the timer operating frequency is too low, the timer resolution will be coarse, relative to the intervals between logic transiti ons. this becomes a problem due to inherent errors caused by the way in which timer counts are captured by software; consequently the boot program might not be able to determine the serial operation mode correctly. (serial operation mode settings must be made again in the programming routine.) for example, the serial operation mode may be determined to be i/o interface mode when the int ended mode is uart mode. to avoid such a situation, when uart mode is utilized, the controller should allow for a time-out period wi thin which it expects to receive an echo-back (86h) from the target board. the controller should give up the communication if it fails to get that echo-back within the allotted time. when i/o interface mode is utilized, once the first uart (0x86) tab bit 7 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 point a point b point c point d i/o interface (0x30) tab tcd tcd tmp19a71 17-37
tmp19a71 serial byte has been transmitted, the controll er should send the sclk clock after a certain idle time to get an acknowledge response. if the received acknowledge response is not 30h, the controller should give up further communications. to select i/o interface mode, the data in the 1s t byte need not be 30h so long as tab > tcd is satisfied. the 1st byte may be 91h, a1h, or b1h; these values generate a falling edge at point a and point c and a rising edge at point b and point d. when tab > tcd is satisfied and i/o interface mode is determined, 30h is transmit ted as the 2nd byte (even if the first byte is not 30h). (here it is assumed that 30h is transmitted as the 1st byte to select i/o interface mode.) tmp19a71 17-38
tmp19a71 start figure 17.3.5 s erial operation mode byte reception flow initialize tmrb0 start prescaler (source clock: imclk/4) tmrb0 starts counting up point a stop operation (infinite loop until reset input) high-to-low transition on serial receive pin? yes yes yes low-to-high transition on serial receive pin? software-capture and save timer value (tab) high-to-low transition on serial receive pin? software-capture and save timer value (tac) yes low-to-high transition on serial receive pin? software-capture and save timer value (tad) tmrb0 stops counting tac tad? make backup copy of tad value end yes point b point c point d tmp19a71 17-39
tmp19a71 start figure 17.3.6 s erial operation mode determination flow 6) password the ram transfer command (10h) causes the boot program to perform a password check. f ollowing an echo-back of the command, the boot program checks the contents of the 12-byte password area (0x0000_0474 to 0x0000_047f) within the flash memory. as shown in figure 17.3.7 , if all these address locations contain the same bytes of data other than ffh, a passwor d area error occurs. in this case, the boot program returns an error acknowledge (11h) in response to the checksum byte (the 17th byte) regardless the result of password check. the only exception is when the password area is all 00h and the data at the first flash memory address (0x0000_0000 in single boot mode) is 0x0000_0000. in this case, 12 bytes of 00h in the password area do not cause a password area error. the password sequence received from the controller (5th to 16th bytes) is compared to the passwor d stored in the flash memory. table 17.3.9 shows how they are compared byte by byte. all of th e 12 bytes must match to pass the pa ssword check. otherwise, a password error occurs, which causes the boot program to return an error acknowledg e in response to the checksum byte (the 17th byte). tcd tad ? tac tab > tcd? yes uart mode i/o interface mode tmp19a71 17-40
tmp19a71 start yes are all bytes equal to 00h and 0x0000_ 0000 = 0? yes are all bytes the same? yes are all bytes equal to ffh? password area is normal. password area error figure 17.3.7 password area check flow table 17.3.9 rel ationship between received bytes and flash memory locations received byte compared flash memory data 5th byte address 0x0000_0474 6th byte address 0x0000_0475 7th byte address 0x0000_0476 8th byte address 0x0000_0477 9th byte address 0x0000_0478 10th byte address 0x0000_0479 11th byte address 0x0000_047a 12th byte address 0x0000_047b 13th byte address 0x0000_047c 14th byte address 0x0000_047d 15th byte address 0x0000_047e 16th byte address 0x0000_047f note: we recommend setting data other than 0 at address 0x0000_0000 for security reasons. tmp19a71 17-41
tmp19a71 7) calculation of the show flash memory sum command the show flash memory sum command adds all 256 kbytes of the flash memory together and pr ovides the total sum as a word quantity. the sum is sent to the controller with the upper 8 bits first, followed by the lower 8 bits. example: a1h b2h c3h d4h in the interests of simplicity, assume the depth of the flash memory is four locations. then the sum of the four bytes is calculated as: a1h + b2h + c3h + d4h = 02eah hence, 02h is first sent to the controller, followed by eah. 8) checksum calculation the checksum byte for a series of bytes of data is calculated by adding the bytes together, drop ping the carries, and taking the two?s complement of the total sum. the show flash memory sum command and the show product information command perform the checksum calculation. the controller must perform the same checksum operation in transmitting checksum bytes. example: assume the show flash memory sum command provides the high- and low-order byt es of the sum as e5h and f6h. to calculate the checksum for a series of e5h and f6h: add the bytes together. e5h + f6h = 1dbh drop the carry, and then take the two?s complement of the sum. the result is the che cksum byte. 0 ? dbh = 25h tmp19a71 17-42
tmp19a71 (7) general boot program flowchart figure 17.3.8 shows an overall flowchart of the boot program. boot program start initialize get sio operation mode data i/o interface sio operation mode? can be set uart stop operation (wait for reset input) set uart mode and baud rate baud rate setting? set i/o interface mode cannot be set ack data received data (30h) ack data received data show product information processing show flash memory sum processing transmit routine (send x1h: command error) transmit routine (send 30h: normal response) transmit routine (send 20h: normal response) yes processed normall y ? yes yes command error show product information? show flash memory sum? transmit routine (send x8h: receive error) ack data ack data (08h) ram transfer processing yes transmit routine (send 0x10:normal response) ack data received data (10h) no receive error? ram t ransfer? prepare ack data receive routine get a command prepare to get a command (send 30h) normal response (send 86h) normal response yes ack data received data (20h) ack data received data (30h) ack data ack data (01h) jump to ram figu re 17.3.8 overall boot program flow tmp19a71 17-43
tmp19a71 (8) handshake operation in i/o interface mode 1) aft er setting sc2mod0.rxe=1, the tmp19a71 dr ives the p80 pin high and waits for the sclk2 signal for receiving data. 2) aft er receiving one byte and generating a re ceive-done interrupt request, the tmp19a71 performs the following sequence of operations: ? drives th e p80 pin low to notify the controller that new data transfer cannot be performed. ? p rocesses the received data (ram storage, checksum verification, sum verification, etc.) and then clears the receive-done interrupt request. ? t hen, drives the p80 pin high to notify the cont roller that it is ready to receive new data and waits for the sclk2 signal for the next receive operation. in figure 17.3.9, the receive wait time is defined as the period between the rising edge of bit 7 of sclk2 and the next rising edge of the p80 pin. 3) the next transfer operation should be initiated after a low-to-high transition is confirmed on the p80 pin. (the controller must optimize the transmit wait time for each transfer format.) note: the receive wait time to be inserted after each receive operation varies depending on the operating frequency and baud rate used and the processing to be performed on received data (checksum verification, ram storage, password area check, password data check, etc.) . sclk txd rxd ivr [ 8: 0 ] rxe hs intr 00 intr 0 receive wait time controller (transmit) tmp19a71 (receive) controller (receive) tmp19a71 (transmit) sclk = sclk2, txd = tx2, rxd = rx2, intt = intrx2, rxe = sc2mod0.rxe, hs = p80 figure 17.3.9 ha ndshake waveform and receive wait time tmp19a71 17-44
tmp19a71 1) after setting sc2mod0.rxe=0 and setting tr ansmit data in the sc2buf, the tmp19a71 drives the p80 pin high and waits for the sclk2 signal for transmitting data. 2) aft er transmitting one byte and generating a transmit-done interrupt request, the tmp19a71 performs the following sequence of operations: ? drives th e p80 pin low to notify the controller that new data transfer cannot be performed. ? p erforms required processing on the transmitted data (checksum verification, sum verification, etc.) and then clears the transmit-done interrupt request. ? then, sets sc2 mod0.rxe to 1 and drives the p80 pi n high to notify the controller that it is ready to receive new data. in figure 17.3.10, the transmit wait time is defi ne d as the period between the rising edge of bit 7 of sclk2 and the next rising edge of the p80 pin. the next transfer operation should be initiated after a low-to-high transition is confirmed on the p80 pin. (the controller must optimize the transmit wait time for each transfer format.) note: the transmit wait time to be inserted after each transmit operation varies depending on the operating frequency and baud rate used and the processing to be performed on transfer data (sc2mod0.rxe setting, checksum verification, ram storage, password verification, etc.). sclk = sclk2, txd = tx2, rxd = rx2, intr = inttx2, intt = intrx2, rxe = sc2mod0.rxe, hs = p80 figure 17.3.10 hand shake waveform and transmit wait time tmp19a71 17-45
tmp19a71 (9)supplementary explanation on determination of a serial operation mode (transmit waveforms and handshaking in i/o interface mode) as explained in subsection 5) determination of a se rial operation mode, each operation command must send a waveform sa tisfying tab>tcd to select i/o interf ace mode. at this time, point a and point c should be programmed to be falling edges and point b and point d to be rising edges. if 30h is transmitted as the 1st byte, the boot program must create at least 1 bit of high level after sending 30h so that a rising edge occurs at poin t d (see figure 17.3.11 below). this measure is not needed if the data to be sent as the 1st byte includes a rising edge at point d (e.g. 91h, d9h). in either case, the serial receive pin must be driven high before entering the procedure for determining a serial operation mode. (we recommend setting the serial receive pin to high upon reset.) in i/o interface mode, the serial receive pin functions as a general-purpose input port for receivin g the 1st byte. the timing at which i/o inte rface mode is determined is after a rising edge at point d, at which point the port pin used for ha ndshaking goes high even if this occurs before bit 7 is transmitted. (if uart mode is determined , no output is made on the handshake pin.) as shown in figure 17.3.11 below, the position of po int d varies with the data transmitted as the 1st byte. after the 1st byte has been transferred, the controller can initiate the transfer of the 2nd byte after the handshake pin goes high, which indicates that the serial operation mode has been determined. transmit data in 1st byte = 30h handshake (hs) pin i/o se tting = after reset state point a point b point c point d point a point b point c point d point a point b point c point d hs rxd hs rxd hs rxd transmit data in 1st byte = 91h transmit data in 1st byte = d9h bit 0bit 1bit 2bit 3 bit 4 bit 5 bit 6 bit 7 extra bit bit 0bit 1bit 2bit 3bit 4bit 5bit 6bit 7 bit 0bit 1bit 2bit 3bit 4bit 5bit 6bit 7 rxd = rx2, hs = p80 figure 17.3.11 supplementary explanation on determination of a serial operation mode tmp19a71 17-46
tmp19a71 (10) recommended baud rates for the boot program table 17.3.10 recommended baud rates in single boot mode (uart mode) prsc = br2cr[5:4], n = br2cr [3:0], k = br2add[3:0] note 1: while the serial operation mode is being determined, the baud rate is determined by measuring the waveform with a timer. capture value errors generated by the prescaler source clock and division errors that occur in the serial mode determination flow may make it impossible to set the baud rate. note 2: the above table shows expected combinations of frequency and baud rate settings, and other combinations ma y be used. note 3: due to the specifications of the boot program, the fastest baud rate setting allowed is br2cr=02h. the contr oller must communicate at a baud rate equal to or slower than this setting. table 17.3.11 recommended baud rate values in single boot mode (i/o interface mode) operating frequency (mhz) 56 40 baud rate in i/o interface mode (bps) 2m 1.25m 1m 500k 250k 125k 3m 2.5m 1.25m 1m 500k 250k note: when i/o interface mode is selected, a wait time is generated after transmitting/receiving every single byte. tmp19a71 17-47
tmp19a71 (11) other considerations for using the boot program ? t he on-chip boot rom inserts one wait state in executing each instruction. in single boot mode, the pipeline operation for executing each instruction takes twice as long as in the case of single-chip mode. ? no wa it states are inserted while the programming routine transferred to the on-chip ram is executed on the on-chip ram. ? t he boot program updates the values of general-purpose registers upon reset. ? t he boot program executes all instructions in 32-bit isa mode. the instruction to be placed at the first address of the programming routine (i.e., ram storage start address) must be a 32-bit isa instruction. ? al l special-purpose registers must be set in the programming routine. ? t he boot program uses the general-purpose register r29 (shadow = 0) as the stack pointer. the r29 is set to 0xffff_bff0 immediately af ter the ram transfer command is executed. ? l ocations other than those to which the programming routine can be transferred with the ram transfer commend (0xffff_9800 to 0xfff f_afff) are used in the boot program after reset. ? there are no limitations on ram locations that can be used by the programming routine stored in the on-chip ram. ? whi le the boot program is being executed, all maskable interrupts are disabled. ? if m askable interrupts are enabled during execution of the programming routine, the maskable interrupt vector of the boot program reads the interrupt vector register (ivr) to obtain the vector address corresponding to the interrupt source, and then transfers control to this vector address. the value of the general-purpose register r4/r29 (sp) is updated by executing the routine shown on the following page. the boot program area does not provide vector addresses for interrupt sources and control for clearing interrupt requests. these should be provided in the programming routine including the setting of the ivr value. tmp19a71 17-48
tmp19a71 interrupts: addi sp, sp, -4 ; maskable interrupt vector start address sw r4, 0( sp ) mfc0 r4, r13 nop nop srl r4, r4, 2 andi r4, r4, 0x1f bne r4, r0, the_other ; if not a maskable interrupt, operation stops nop lw r4, ivr ; read ivr lw r4, 0( r4 ) ; read maskable interrupt vector address addi sp, sp, 4 jr r4 ; jump to vector address nop the_other: addi sp, sp, 4 the_other_lp: nop j the_other_lp ; operation stop loop nop note: after an interrupt is generated, one wait state is inserted for executing each instruction until control jumps to the v ector address. ? nonmask able interrupts must not be used as they will cause an endless loop in the boot program. if an endless loop occurs, a reset must be applied. ? once contr ol jumps to the programming routine, it should not be returned to the boot program area except by the above maskable interrupt vector. ? init ial settings should be made before the procedure for determining a serial operation mode. after the reset state is released, an interval of approximately 200 instructions should be inserted before the transfer of the 1st byte. note that the 1st byte is not transferred via a serial channel. to detect a falling edge on the serial receive pin, the serial receive pin must be set to high well in advance of the completion of the above wait interval. (we recommend setting the serial receive pin to high upon reset.) tmp19a71 17-49
tmp19a71 17.4 on-board programming and erasure the tmp19a71 flash memory is co ntrolled by commands. in user boot mode and single boot mode (the ram transfer command), the flash memory can be programmed and erased by the tx19a core processor executing so ftware commands. it is the user?s responsibility to create a program/erase routine. because the flash memory cannot be read while it is being programmed or erased, the program/erase routine must be executed from the on-chip ram. 17.4.1 key features program and erase operations on the tmp19a71 flash memory are in principle controlled by commands. this feature enables program and erase commands to be executed by accessing particular addresses in the flas h memory. the tx19a core processor issues a command sequence to the flash memory by using the 32-bit sw instruction. once a command sequence is written, the flash memory does not require the tx19a core processor to provide further controls or timings. the flash memory initiates the embedded program or erase algorithm automatically. the entire flash memory or one or two flash blocks can be erased at a time. table 17.4.1 feature description auto program programs and verifies the desir ed addresses w ord by word automatically. auto chip erase erases and verifies t he entire me mory array automatically. auto block erase erases and verifies all memory locations in the selected block automatically. auto multi-block erase erases and veri fies all memor y locations in multip le selected blocks automatically. write status flags provides several status bits such as the data polli ng bit and toggle bit, which can be used to determine whether a program or erase operation is complete or in progress. anti-programmer security feature prevents intrusive access to the flash memory w hile in programmer mode. protecting both of the two flash blocks turns on the anti-programmer security feature. unprotecting both the blocks turns off the anti-programmer security feature. this automatically c auses the entire flash memory to be erased. block protect disables program and er ase operations in a f lash block. bl ock-protecting both of the two flash blocks automatically turns on the ant i-programmer security feature. bear in mind that, due to the on-chip tx19a core processor interface, the tmp19a71 uses addr esses different from those of the standard flash command sequences. programming is done word by word; thus the wo rd (32 bits) load instruction should be used to write to the flash memory. unless otherwise noted, the addresses in the flash memory are represented as virtual addresses. tmp19a71 17-50
tmp19a71 (1) block architecture 0x0_0000 to 0x1_ffff 128 kbytes 0x2_0000 to 0x3_ffff 128 kbytes address bits [31:18] vary with the operation mode. figure 17.4.1 fla sh memory block architecture (2) interface between the tx19a core processor and the flash memory figure 17.4.2 illustrates the internal interface between the tx19a core processor and the flash m emory in on-board programming modes. the diagram does not show the actual logic network; instead it is only a conceptual depiction of the interface between the tx19a core processor and the flash memory. single-chip mode: 0xbfc0_0000 - 0xbfcf_ffff single boot mode: 0x0000_0000 - 0x000f_ffff operation mode flash memory tx19a core processor (256 kb) decoder dq31 - dq0 d31- d0 a31 - a16 a16 - a2 ad14 - ad0 ce we oe wr rd rdy/bsy reset cpu reset register figure 17.4.2 internal interface between tx19a core processor and flash memory tmp19a71 17-51
tmp19a71 (3) basic operations the tmp19a71 flash memory has the fo llo wing two modes of operation: read mode in which array data is read ? ? ? ? embedded operation mode in which the flash array is programmed or erased. the flash memory enters embedded operation mode when a valid command sequence is ex ecuted in read mode. in embedded opera tion mode, array data cannot be read. 1) reading array data t o read array data, the flash memory must be set to read mode. the flash memory is automatically set to read mode upon device power-up, upon reset of the tx19a core processor, and after an embedded operation is successfully completed. if an embedded operation terminated abnormally or the flash memory is required to return to read mode, software reset or hardware reset is used. 2) writing commands the tmp19 a71 flash memory is controlled by commands. a write to the command sequencer is effected by issuing a command sequence to the flash memory. the flash memory latches the provided address and data in the command sequ encer and executes the required instructions (see table 17.4.4 and table 17.4.5 ). t he command sequence being written can be canceled by issuing the read/reset command or the reset command (software reset). the reset command clears the command sequencer and resets the flash memory to read mode. invalid command sequences also cause the flash memory to clear the command sequen cer and return to read mode. 3) reset read/reset command, reset command (software reset) the flash m emory does not return to read mode automatically if an embedded operation terminated abnormally. in this case, the read/r eset or reset command mu st be issued to put the flash memory back in read mode. the read/r eset or reset command may also be written between sequence cycles of the command being written to clear the contents of the command sequencer. hardware reset as shown in figure 17.4.2 , the flash memory has a reset pin, which is connected to the reset signa l of the tx19a core processor. when the system drives the reset pin low or when certain events such as a watchd og timer time-out causes a reset of the tx19a core processor, the flash memory immediately terminates any operation in progress an d is reset to read mode. the read/reset and reset commands are also tied to the reset pin to reset the flash memory to read mode. the embedded operation that was interrupted should be re-initiated once the flash memory is ready to accept another command sequence because data may be corrupted. for a description of the hardware reset operat ion, see section 3.1 reset operation. when a valid reset is achieved, the tx19a core processor reads the reset exception vector from the flash memory and services the reset exception. tmp19a71 17-52
tmp19a71 4) auto program command a bit must be programmed to change its state fr om 1 to 0. a bit cannot be programmed from 0 back to 1. only an erase operation can change 0 back to 1. in user boot mode and the ram transfer command of single boot mode, the auto program command programs the desired addresses in units of 32 bits (words). the auto program command requires four bus cycles; the program address and data are written in the fourth cycle, upon completion of which the program operation will commence. as programming is performed on a word-by-word basis, the program address must satisfy a1=a0=0. it is not possible to program a 32-bit word if some bits have already been written. (this also app lies when 1 is written in some bits. these bits must be erased before new data can be programmed.) the auto program command executes a sequence of internally timed events to program the desir ed bits of the addressed memory word and verify that the desired bits are sufficiently programmed. the system can determine the status of the programming operation by using write status flags (see table 17.4.3 ). any commands written during the programming op eration are ignored. a hardware reset immediately terminates the programming operation. the programming operation that was interrupted should be reinitiated once the flash memory is ready to accept another command sequ ence because data may be corrupted. the block protection feature disables programming operation in any block. if an attempt is m ade to program a protected block, the auto program command does nothing; the flash memory returns to read mode in approximately 3 s after the completion of the fourth bus cycle of the command sequence. when the embedded auto program algorithm is complete, the flash memory returns to read mode. if any failure occurs during the programming operation, the flash memory remains locked in em bedded operation mode. the system can determine this status by using write status flags. to put the flash memory back in read mode, use a software reset to reset the flash memory or a hardware reset to reset the whole chip. in case of a programming failure, it is recommended to replace the chip or to discontinue the use of the failing flash block. tmp19a71 17-53
tmp19a71 5) aut o chip erase command the auto chip erase command requires six bus cycles. the flash area is partitioned into two blocks, block 0 and block 1. the chip erase operation is performed for each individual block. after completion of the sixth bus cycle, the auto chip erase operation will commence immediately. the embedded auto erase algorithm automatically preprograms the entire memory for an all-0 data pattern prior to the er ase; then it automatically erases and verifies the entire memory for an all-1 data pattern. the system can determine the status of the chip erase operation by using write status flags (see table 17.4.3 ). any commands written during the ch ip erase operation are ignored. a hardware reset immediately terminates the chip erase operation. the chip erase operation that was interrupted should be re-initiated once the flash memory is ready to accept another command sequence because data may be corrupted. the block protection feature disables erase op erations in any block. the auto chip erase algorithm erases the unprotected blocks and igno res the protected blocks. if both blocks are protected, the auto chip erase command does nothing; the flash memory returns to read mode in approximately 100 s after the completion of the sixth bus cycle of the command sequence. when the embedded auto chip erase algorithm is complete, the flash memory returns to read mode. if any failure occurs during the erase operation, the flash memory remains locked in embedded operation mode. the system can determine this status by using write status flags. to put the flash memory back in read mode, use a software reset or a hardware reset to reset the flash memory or the device. in case of an erase failure, it is recommended to replace the chip or discontinue the use of the failing flash block. the failing block can be identified by the block erase command. 6) aut o block erase and auto multi-block erase commands the auto block erase command requires six bus cycles. a time-out begins from the completion of the command sequence. after a time-out, the erase operation will commence. the embedded auto block erase algorithm automatically preprograms the selected block for an all-0 data pattern, and then erases and veri fies that block for an all-1 data pattern. to erase the next block, the sixth bus cycle must be repeated; the next block address and the auto block erase command must be provided within the time-out period. any command other than auto block erase during the time-out period resets the flash memory to read mode. the block erase time-out period is 50 s. the system may read dq3 to determine whether the time-out period has expired. the block erase timer begins counting upon completion of the sixth bus cycle of the auto block erase command sequence. the system can determine the status of the erase operation by using write status flags (see table 17.4.3 ). any commands written during the block erase operation are ignored. a hardware reset immediately terminates the block erase operation. the block erase operation that was interrupted should be re-initiated once the fl ash memory is ready to accept another command sequence because data may be corrupted. the block protection feature disables erase operations in any block. the auto block erase algorithm erases the unprotected blocks and igno res the protected blocks. if all the selected blocks are protected, the auto block erase algo rithm does nothing; the flash memory returns to read mode in approximately 100 s after the final bus cycle of the command sequence. if any failure occurs during the erase operation, the flash memory remains locked in embedded operation mode. the system can determine this status by using the write status flags. to put the flash memory back in read mo de, use a software or ha rdware reset to reset the flash memory or the whole chip. in case of an erase failure, it is recommended to replace the chip or discontinue the use of the failing flash block. if any failure occurred during the tmp19a71 17-54
tmp19a71 multi-block erase operation, the failing block can be identified by running auto block erase on each of the blocks selected for multi-block erasure. 7) block protect command the block protection feature disables both prog ra m and erase operations in any block. after completion of the seventh bus write cycle, the rdy/bsy bit in the flcs register is cleared to 0 during the block protect operation. once the block protect operation is complete, this bit is set again and the flash memory automa tically returns to read mode. if any failure occurred during the block protect operation, the flash memory remains locked in embedded operation mode with flcs.rdy/bsy = 0. to put the flash memory back in read mode, a software or hardware reset must be executed. table 17.4.2 ef fects of the program and erase commands on the protected blocks command operation program command on a protected block no prog ramming operation is performed, and the flash memory automatically returns to read mode. block erase command on a protected block no eras e ope ration is performed, and the flash memory automatically returns to read mode. chip erase command when all the blocks are protected no erase ope ration is performed, and the flash memory automatically returns to read mode. chip erase command when any blocks are protected only th e unprotected blocks are erased. upon completion, the flash memory automatically returns to read mode. multi-block erase command when any blocks are protected o nl y the unprotected blocks are erased. upon completion, the flash memory automatically returns to read mode. any commands written during the block protect algorithm are ignored. a hardware reset immediately terminates the block protect operation. the block protect command that was interrupted should be re-initiated once the fl ash memory is ready to accept another command sequence. 8) block unprotect command the block unprotect command requires seven bus cycles. after completion of the seventh bus wri te cycle, the rdy/bsy bit in the flcs register is cleared to 0 during the block unprotect operation. once the block unprotect operation is complete, this bit is set again and the flash memory automatically returns to read mode. if any failure occurred during the block unprotect operation, the flash memory remains locked in embedded operation mode with flc s.rdy/bsy = 0. to put the flash memory back in read mode, a software or hard ware reset must be executed. any commands written during the block unpr otect algorithm are ignored. a hardware reset immeidately terminates the block unprotect operation. in this case, the block unprotect operation must be performed again by starting with protecting all the blocks again. use the verify block protect command to verify the protect status of a block. 9) v erify block protect command the verify block protect command is used to verify the protect status of a block. verify block p rotect is a four-bus-cycle operation. the address of the block to be verified is given in the fourth cycle. any address within the block range will suffice, provided a[3:0] = 0, a4 = 1 and a6 = 0. to get correct data, a 32-bit read must be performed at least twice. use the last read as valid data. if the selected block is protected, a value of 0x0000_0001 is returned. if the selected block is not protected, a value of 0x0000_0000 is returned. following the fourth bus cycle, an tmp19a71 17-55
tmp19a71 additional block address may be read. the verify block protect command does not return the flash memory to read mode. either the read/reset command or a hardware reset is required to reset the flash memory to read mode or to write the next command. 10) id-read command the id-read command reads 0x009 8 (fixed) as toshiba?s manufacturer?s code. the flash memory address to be read is specified in the fo urth bus read cycle. this address must satisfy a[4:0] = 0 and a6 = 0. to get correct data, a 32- bit read must be performed at least twice. use the last read as valid data. by specifying an address where data other than 0x0098 is stored, the id-read command can be used to distinguish between the flash-version device (read value: 0x0098) and the mask-version device (read value: other than 0x0098). tmp19a71 17-56
tmp19a71 11) write operation status as shown in table 17.4.3 , the flash memory provides flag bi ts to determine the status of an embedded operation: dq7, dq5 and dq3. these st atus bits can be read during an embedded operation in the same timing as for read mo de. the flash memory automatically returns to read mode when an embedded operation completes. the status of an embedded operation can be checked by reading the dq7 flag. once an embedded operation completes, the cell data can be read from the dq7. the dq7 must be read after checking that an embedded operation has started (flcs.rdy/bsy=0). during the embedded program operation, the system must provide the program address (with a[1:0] = 0) to read valid status informat ion. during the embedded erase operation, the system must provide an address (with a[1:0] = 0) within any of the blocks selected for erasure to read valid status information. while an embedded operation is in progress, d[ 31: 16] are read as 0. these bits, therefore, can be used in place of the flcs.rdy/bsy bit in a system where d[31:16] are not normally 0. although the flcs register is read as undefined in the mask-version device, use of d[31:16] allows the same program to be used in the flash-version and mask-version devices. table 17.4.3 w rite status flags status d7 (dq7) d5 (dq5) d3 (dq3) a uto program dq7 inverted 0 0 a uto erase ( during the time-out window) 0 0 0 e mbedded operation in progress a uto erase 0 0 1 a uto program dq7 inverted 1 1 t ime-out in embedded operation a uto erase 0 1 1 note 1: while an embedded operation is in progress, d[31:16]=0, d[15:8]=undefined, and dq4, dq2, dq1, dq0=undefined. note 2: while an embedded operation is in progress, dq7 outputs the inverted value of the programmed cell dat a. during the auto erase operation, dq7 outputs 0 (erased state = 1). tmp19a71 17-57
tmp19a71 dq7 (data polling) ? ? ? the data polling bit, dq7, indicates the status of an embedded operation. data polling is valid after the final bus write cycle of an embedded command sequence. when the embedded program algorithm is in pr ogress, an attempt to read the flash memory will produce the complement of the data writ ten to dq7. upon completion of the program algorithm, an attempt to read the flash memory will produce the true data written to dq7. when the embedded erase algorithm is in progre ss, an att empt to read the flash memory will produce a 0 at the dq7 output. upon completion of the erase algorithm, the flash memory will produce a 1 at the dq7 output. if any failure occurs during an embedded operation, dq7 continues to output the same value. thus, dq7 must always be polled in conjunction with the exceeded timing limits (dq5) flag. (see table 17.4.3 ). the flash memory disables address latching when an embedded operation is complete. data polling must be performed with a valid progra mmed address or an address within any of the unprotected blocks selected for erasure. dq5 (exceeded timing limits) dq5 produces a 0 while the program or erase op er ation is in progress normally. dq5 produces a 1 to indicate that the program or erase time has exceeded the specified internal limit. this is a failure condition that indicates the program or erase cycle was not successfully completed. the dq5 failure condition also appears if the system tries to program a 1 to a location that was previously pr ogrammed to a 0. only an erase oper ation can change a 0 back to a 1. in this case, the embedded program algorithm halts the operation. once the operation has exceeded the timing limits, dq5 will indicate a 1. note that this is not a device failure condition since the flash memory was used incorrectly. under both these conditions, the flash memory remains locked in embedded operation mode. a software reset is needed to retu rn the flash memory to read mode. dq3 (block erase timer) aft er the completion of the sixth bus cycle of the auto block erase command sequence, the block erase time-out window of 50 s begins. the erase operation will begin after the time-out has expired. when the time-out is complete and the erase operation has begun, dq3 switches from 0 to 1. if dq3 is 0, the flash memory will accept additional auto block erase commands. each time an auto block erase command is wr itten, the time-out window is reset. dq3 produces a 1 if an embedded operation is not successfully completed. tmp19a71 17-58
tmp19a71 12) flash control/status register this is a 32-bit register for monitori n g the status of the flash memory. in programmer mode, the rdy/bsy output is provided for the host system to monitor the sta tus of an embedded algorithm. the tx19a core processor can poll the rdy/bsy bit in the flcs register for the same purpose. the rdy/bsy bit is cleared to 0 when the flash memory is performing an embedded operation. the rdy/bsy bit is set to 1 when an embedded operation has completed and the flash memory is ready to accept the next command. if any failure occurs during an embedded operation, this bit remains 0. a hardware reset sets this bit to 1. the rdy/bsy bit is cleared to 0 upon completion of the final bus write cycle of an embedded operation command, with one exception. in the case of the auto block erase command, this bit is cleared after the time-out has expired. any command is ignored while the rdy/bsy bit is cleared. 7 6 5 4 3 2 1 0 flcs bit sy mbol D D D D mrom rdy/bsy D D (0xffff_e520) read/write w r r r/w r r w r reset v alue 0 0 0 0 0 1 0 0 function must be set to 0. must be set to 0. 0:flash 1:mask ready/busy 0: busy 1: ready must be set to 0. 15 14 13 12 11 10 9 8 bit sy mbol D D D D D D D D read/write r r r r r r r r reset v alue 0 0 0 0 0 0 0 0 23 22 21 20 19 18 17 16 bit sy mbol D D D D D D D D read/write r r r r r r r r reset v alue 0 0 0 0 0 0 0 0 31 30 29 28 27 26 25 24 bit sy mbol D D D D D D D D read/write w r r r r r r r reset v alue D 0 0 0 0 0 0 0 note 1: this register must be accessed as a 32-bit quantity. note 2: this register does not support bit manipulation instructions. note 3: in the mask-version device, the mrom bit is set to 1 and any other bits are read-only with the same initial v alues. tmp19a71 17-59
tmp19a71 13) flash security t he tmp19a71 flash memory supports not only on-board programming but also programming using a general-purpose programmer. therefore, the tmp19a71 flash memory provides a security feature to prevent intrusive access to the flash memory while in programmer mode. the tmp19a71 is secured when both of the two bl ocks are protected, and the contents of the flash memory cannot be read by a programmer. turning on the anti-programmer security fe ature (disabling read accesses) turning on the anti-programmer security feature disables a general-purpose programmer from reading the contents of the flash memory. to turn on this feature, once programming is complete, protect both the flash blocks. if ei ther one of the blocks is unprotected, the anti-programmer security feature is off. in on-board programming modes, the tx19a core processor can read the flash memory even if the anti-programmer security feature is on. when the anti-programmer security feature is on, any reads by programming equipment will always return a half-word length value of 0x0098. ? ? turning off the anti-programmer securi ty feature (enabling read accesses) the anti-programmer security fe ature is designed to disable reads of the flash memory by programming equipment. while the tmp19a71 is soldered on a board, the tx19a core processor can always read the flash me mory, regardless of whether or not the anti-programmer security feature is on. since the flash memory is placed under control of a user?s application program in on-board operating modes, it is not easy for third parties to perform intrusive access to the flash memory. therefore, within the confines of a board, the flash memory does not need to be secured. the anti-programmer security feature can be turned off by unprotecting both of the two flash blocks. prior to turning off the anti-programmer security feature, the flash array is erased unconditionally. after the flash array is erased, the protect bit of each block is erased to turn off the anti-programmer security feature. in single-chip mode, block protection is lifted in a user application program. thus, the flash memo ry is not erased when the anti-programmer security feature is turned off. tmp19a71 17-60
tmp19a71 (4) command definitions table 17.4.4 on-board programming mode command definitions 1st bus cycle (write) 2nd bus cycle (w rite) 3rd bus cycle (w rite) 4th bus cycle (read/write ) command sequence cycles required addr. data addr. data addr. data addr. data reset 1 0xxxxx 0x0f0 read/reset 3 0x5554 0x0aa 0x aaa8 0x055 0x5554 0x0f0 ra rd auto program 4 0x5554 0x0aa 0xaaa8 0x055 0x5554 0x0a0 pa pd auto chip erase 6 0x5554 0x0 aa 0xaaa8 0x055 0x 5554 0x080 0x5554 0xaa auto block erase 6 0x5554 0x0 aa 0xaaa8 0x055 0x 5554 0x080 0x5554 0xaa block protect 0x5554 0x0aa 0xaaa8 0x055 0x5554 0x09a 0x5554 0xaa block unprotect 0x5554 0x0aa 0xaaa8 0x055 0x5554 0x06a 0x5554 0xaa id read/ block protect verify 4 0x5554 0x0aa 0xaaa8 0x 055 0x5554 0x090 ia id (continued from above) 5th bus cycle (write) 6th bus cycle (w rite) 7th bus cycle (w rite) command sequence cycles required addr. data addr. data addr. data reset 1 read/reset 3 auto program 4 auto chip erase 6 0xaaa8 0x055 0x5554 0x010 auto block erase 6 0xaaa8 0x055 ba 0x030 ba (note 3) 0x030 block protect 7 0xaaa8 0x055 0x5554 0x09a bpa 0x09a block unprotect 7 0xaaa8 0x055 0x5554 0x06a 0x5554 0x06a id read/block protect verify 4 note 1: after every bus write cycle, execute the sync and nop instructions in sequence. note 2: in each bus write cycle, bits 16 to 19 should be set to the value coresponding to the flash memory address. note 3: for a multi-block erase operation, add ba in the 7th and subsequent bus write cycles. note 4: to operate on the flash memory, the watchdog timer must be disabled. tmp19a71 17-61
tmp19a71 the addresses to be provided by the tx19a core processor are shown below. table 17.4.5 addresses provided by the tx19a core processor command address address: a[23:0] addr. a[23:16] a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 0xxxx0 x x x x x x x x x x x x 0 0 0 0 0x0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0xaaa8 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0x5554 flash memory block 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 (5) miscellaneous ? 0x0f0, 0 x0aa, 0x055, 0x0a0, 0x080, 0x09a, 0x06a, 0x090, 0x010, 0x030 command sequence write data d[8:0]. to write command data, use a 32-bit (word) load (sw) instruction with d[31:9] = 0. ? r a: read address any address in the flash me mo ry can be specified. ? rd: re ad data the data at the ra (read address) can be read b y using an 8-bit (byte) 16-bit (half-word) or 32-bit (word) load instruction. ? p a: program address any flash memory address (a[1:0]=0) to be pr ogrammed can be specified. ? pd: pro gram data by using a 32-bit (word) sw instruction, the p a (program address) can be programmed to the specified data. ? ia: id address the flash memory address (a[1:0]=0) on which the id-read or verify block protect co mmand is to be executed. table 17.4.6 ia (id address) table a17 a6 a4 a3 id id-read (manufacturer?s code) x 0 0 0 0x0098 (fixed) 0x0000_0001 (block 0 protected) verify block 0 protect 0 0x0000_0000 (block 0 not protected) 0x0000_0001 (block 1 protected) verify block 1 protect 1 0 1 0 0x0000_0000 (block 1 not protected) ? id: id data the data that indicates the result of id-read or verify block protect executed on the ia (id addr ess). tmp19a71 17-62
tmp19a71 ? ba: block address the flash memory address (a[1:0]=0) to specify the block to be erased. for example, in user bo ot mode, block 0 can be selected by executing the lw instruction on an address in the range of 0xbfc0_0000 to 0xbfc1_ffff (0x0000_0000 0x0001_ffff). ? bp a: block protect address the flash memory address (a[1:0]=0) to specify the block to be protected. for example, in user bo ot mode, block 0 can be selected by executing the lw instruction on an address in the range of 0xbfc0_0000 to 0xbfc1_ffff (0x0000_0000 0x0001_ffff). table 17.4.7 ba (block address) and bpa (block protect address) table user boot mode single boot mode size a17 block 0 0xbfc0_0000 to 0xbfc1_ffff (or 0x0000_0000 to 0x0001_ffff) 0x0000_0000 to 0x0001_ffff 128 kbytes 0 block 1 0xbfc2_0000 to 0xbfc3_ffff (or 0x0002_0000 to 0x0003_ffff) 0x0002_0000 to 0x0003_ffff 128 kbytes 1 (6) programming examples (a) programming example for id-read lui r4,0x0000 ; r4=0x0000_xxxx addiu r4,r4,0x5554 ; r4=0x0000_5554 lui r5,0x0000 ; r5=0x0000_xxxx ori r5,r5,0xaaa8 ; r5=0x0000_aaa8 ori r6,r0,0 x00aa ; 1st bus write cycle sw r6,0( r4) ; 1st 0x0000_5554 <-- 0x00aa sync nop ori r6,r0,0 x0055 ; 2nd bus write cycle sw r6,0( r5) ; 2nd 0x0000_aaa8 <-- 0x0055 sync nop ori r6,r0,0 x0090 ; 3rd bus write cycle sw r6,0( r4) ; 3rd 0x0000_5554 <-- 0x0090 sync nop ori r6,r0,0 x00aa ; 4th bus read cycle lw r7,0( r0) ; 4th 0x0000_0000(ia:a6=a4=a3=a1=a0 =0) --> r7(dummy) lw r7,0( r0) ; 4th 0x0000_0000(ia:a6=a4=a3=a1=a0 =0) --> r7(dummy) lw r7,0( r0) ; 4th 0x0000_0000(ia:a6=a4=a3=a1=a0 =0) --> r7 sync nop tmp19a71 17-63
tmp19a71 (b) programming example for polling the flcs.rdy/bsy bit lui r7,hi(flcs) ; r7=0xffff_xxxx addiu r7,r7,lo( flcs) ; r7=0xffff_e520 (flcs address) rdybsy_lp: ; rd y/bsy poiing lw r6,0( r7) ; r6 <-- flcs andi r6,r6,0 x04 ; mask bits other than flcs.rdy/bsy beq r6,r0, rdybsy_lp ; loop until flcs.rdy/bsy=1 nop (c) programming example for erasing bl ock 1 and polling the write status flags lui r4,0x0002 addiu r4,r4,0x5554 ; r4=0x0002_5554 lui r5,0x0002 ori r5,r5,0xaaa8 ; r5=0x0002_aaa8 ori r6,r0,0 x00aa ; 1st bus write cycle sw r6,0( r4) ; 1st 0x0002_5554 <-- 0x00aa sync nop ori r6,r0,0 x0055 ; 2nd bus write cycle sw r6,0( r5) ; 2nd 0x0002_aaa8 <-- 0x0055 sync nop ori r6,r0,0 x0080 ;3rd bus write cycle sw r6,0( r4) ; 3rd 0x0002_5554 <-- 0x0080 sync nop ori r6,r0,0 x00aa ; 4th bus write cycle sw r6,0( r4) ; 4th 0x0002_5554 <-- 0x00aa sync nop ori r6,r0,0 x0055 ; 5th bus write cycle sw r6,0( r5) ; 5th 0x0002_aaa8 <-- 0x0055 sync nop ori r6,r0,0 x0030 ; 6th bus write cycle sw r6,0( r5) ; 6th 0x0002_aaa8(a17=1) <-- 0x0030 sync ; s tart erasing block 1 nop dq3_lp: ; s tart polling the write status flags lw r6,0( r5) ; read data at 0x0002_aaa8 tmp19a71 17-64
tmp19a71 andi r7,r6,0x08 ; mask flags other than dq3 beq r7,r0,dq3_lp ; if during the time-out (dq3=0), go to dp3_lp nop dq7_lp: lw r6,0( r5) ; read data at 0x0002_aaa8 again andi r7,r6,0 x80 ; mask flags other than dq7 bne r7,r0,da ta_chk ; if dq7=1, go to data_chk nop andi r7,r6,0 x20 ; mask flags other than mdq5 beq r7,r0,dq 7_lp ; if dq5=0 (busy), go to dq7_lp nop lw r6,0( r5) ; read data at 0x0002_aaa8 again andi r7,r6,0 x80 ; mask flags other than dq7 beq r7,r0,e rase_err ; if dq7=0, go to error routine nop data_chk: nor r7,r0,r0 ; r7=0xffff_ffff lw r6,0( r5) ; read data at 0x0002_aaa8 again beq r7,r6,complete ; if erased properly, go to end routine nop erase_err: ori r6,r0,0x00f0 ; software reset sw r6,0( r0) ; 1st 0x0000_0000 <-- 0x00f0 sync ; return to read mode nop complete: (omitted ) ; end routine note: these programming examples assume the use of a toshi ba assembler . if a third-party assembler is used, syntax errors may occur. change the code as necessary according to the assembler to be used. tmp19a71 17-65
tmp19a71 (7) embedded algorithms auto program command sequence (shown below) last address? start no data polling bit (read as a word quantity) yes auto program done address = address + 4 (word-by-word) auto program command sequence (address command) 0x5554(addr.)/0xaa(data) 0xaaa8(addr.)/55h(data) 0x5554(addr.)/a0h(data) program address (a1, a0 = 0) / program data (word-by-word)) figure 17.4.3 auto program operation tmp19a71 17-66
tmp19a71 auto erase command sequence (shown below) start data polling bit (read as a word quantity) auto erase done auto chip erase command sequence (address/command) 0x5554(addr.)/0xaa(data) 0xaaa8(addr.)/0x55(data) 0x5554(addr.)/0x80(data) 0x5554(addr.)/0xaa(data) 0xaaa8(addr.)/0x55(data) 0x5554(addr.)/0x10(data) auto block/multi-block erase command sequence (address/command) 0x5554(addr.)/0xaa(data) 0xaaa8(addr.)0x55(data) 0x5554(addr.)/0x80(data) 0x5554(addr.)/0xaa(data) 0xaaa8(addr.)/0x55(data) block address/0x30(data) block address/0x30(data) a dditional addresses for auto multi-block erase (each within 50 s) block address/0x30(data) figure 17.4.4 auto erase operations tmp19a71 17-67
tmp19a71 start read a word. addr. = va dq5 = 1? yes dq7 = data? read a word. addr. = va no yes yes dq7 = data? no no read a word. addr. = virtual address compare with 32-bit quantity. fail pass figure 17.4.5 data polling (dq7) algorithm tmp19a71 17-68
under development tmp19a71 tmp19a71 18-1 18. i/o register summary 18.1 register map i/o registers occupy 16-kbyte addresses from ffffc000h through ffffffffh. (1) ports (2) motor control circuit (pmd: programmable motor driver) (3) encoder input circuit (4) serial i/o (sio) (5) 16-bit timer/event counter (tmrb) (6) watchdog timer (7) ad converter (8) interrupts (9) clock/standby control (10) dma controller (dmac) (11) flash memory (12) rom correction
tmp19a71 tmp19a71 18-2 [1] ports address mnemonic address mnemonic address mnemonic address mnemonic ffffc000h p0d ffffc010h reserved ffffc020h reserved ffffc030h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h p0cr 4h p0pucr 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h p0ier 8h reserved 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch p0dssr ch reserved ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffc040h p1d ffffc050h reserved ffffc060h reserved ffffc070h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h p1cr 4h p1pucr 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h p1ier 8h reserved 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch p1dssr ch reserved ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffc080h p2d ffffc090h reserved ffffc0a0h reserved ffffc0b0h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h p2cr 4h p2pucr 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h p2ier 8h reserved 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch p2dssr ch reserved ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh
under development tmp19a71 tmp19a71 18-3 address mnemonic address mnemonic address mnemonic address mnemonic ffffc0c0h p3d ffffc0d0h reserved ffffc0e0h reserved ffffc0f0h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h p3cr 4h p3pucr 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h p3ier 8h reserved 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch p3dssr ch reserved ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffc100h reserved ffffc110h reserved ffffc120h reserved ffffc130h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h reserved 4h reserved 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h reserved 8h reserved 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch reserved ch reserved ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffc140h p5d ffffc150h reserved ffffc160h reserved ffffc170h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h reserved 4h p5pucr 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h p5ier 8h p5fr 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch reserved ch reserved ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh
tmp19a71 tmp19a71 18-4 address mnemonic address mnemonic address mnemonic address mnemonic ffffc180h p6d ffffc190h reserved ffffc1a0h reserved ffffc1b0h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h p6cr 4h p6pucr 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h p6ier 8h p6fr 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch p6dssr ch reserved ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffc1c0h p7d ffffc1d0h reserved ffffc1e0h reserved ffffc1f0h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h p7cr 4h p7pucr 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h p7ier 8h p7fr1 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch p7dssr ch p7fr2 ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic fffc200h p8d ffffc210h p8odcr ffffc220h reserved ffffc230h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h p8cr 4h p8pucr 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h p8ier 8h p8fr 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch p8dssr ch reserved ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh
under development tmp19a71 tmp19a71 18-5 address mnemonic address mnemonic address mnemonic address mnemonic ffffc240h p9d ffffc250h reserved ffffc260h p9ecr ffffc270h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h p9cr 4h p9pucr 4h p9eclr 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h p9ier 8h p9fr1 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch p9dssr ch p9fr2 ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffc280h pad ffffc290h reserved ffffc2a0h paeclr ffffc2b0h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h pacr 4h papucr 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h paier 8h pafr 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch padssr ch paecr ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffc2c0h pbd ffffc2d0h reserved ffffc2e0h pbeclr ffffc2f0h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h pbcr 4h pbpucr 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h pbier 8h pbfr 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch pbdssr ch pbecr ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh
tmp19a71 tmp19a71 18-6 [2] pmd address mnemonic address mnemonic address mnemonic address mnemonic ffffc300h mdcr0 ffffc310h cmpv0 ffffc320h emgcr0 ffffc330 trgcmp02 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h mdcnt0 4h cmpw0 4h trgcr0 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h mdprd0 8h mdout0 8h trgcmp00 8h 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch cmpu0 ch emgrel0 ch trgcmp01 ch dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffc340h mdcr1 ffffc350h cmpv1 ffffc360h emgcr1 ffffc370 trgcmp12 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h mdcnt1 4h cmpw1 4h trgcr1 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h mdprd1 8h mdout1 8h trgcmp10 8h 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch cmpu1 ch emgrel1 ch trgcmp11 ch dh dh dh dh eh eh eh eh fh fh fh fh [3] abz encoder address mnemonic address mnemonic address mnemonic ffffc400h entncr ffffc410h reserved ffffc420h 1h 1h 1h 2h 2h 2h 3h 3h 3h 4h enreload 4h 4h 5h 5h 5h 6h 6h 6h 7h 7h 7h 8h enint 8h 8h 9h 9h 9h ah ah ah bh bh bh ch encnt ch ch dh dh dh eh eh eh fh fh fh
under development tmp19a71 tmp19a71 18-7 [4] sio address mnemonic address mnemonic address mnemonic address mnemonic ffffc480h sc0mod0 ffffc490h sc0buf ffffc4a0h sc1mod0 ffffc4b0h sc1buf 1h sc0mod1 1h 1h sc1mod1 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h sc0cr 4h sc0fcnf 4h sc1cr 4h sc1fcnf 5h sc0mod2 5h 5h sc1mod2 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h br0cr 8h sc0ftc 8h br1cr 8h sc1ftc 9h br0add 9h sc0frc 9h br1add 9h sc1frc ah ah ah ah bh bh bh bh ch ch sc0fts ch ch sc1fts dh dh sc0frs dh dh sc1frs eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffc4c0h sc2mod0 ffffc4d0h sc2buf ffffc4e0h sc3mod0 ffffc4f0h sc3buf 1h sc2mod1 1h 1h sc3mod1 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h sc2cr 4h sc2fcnf 4h sc3cr 4h sc3fcnf 5h sc2mod2 5h 5h sc3mod2 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h br2cr 8h sc2ftc 8h br3cr 8h sc3ftc 9h br2add 9h sc2frc 9h br3add 9h sc3frc ah ah ah ah bh bh bh bh ch ch sc2fts ch ch sc3fts dh dh sc2frs dh dh sc3frs eh eh eh eh fh fh fh fh [5] tmrb address mnemonic address mnemonic address mnemonic address mnemonic ffffc700h tb0run ffffc710h tb0reg1 ffffc720h tb1run ffffc730h tb1reg1 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h tb0mod(l) 4h tb0cp0 4h tb1mod(l) 4h tb1cp0 5h (tb0modh) 5h 5h (tb1modh) 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h tb0ff 8h tb0cp1 8h tb1ff 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch tb0reg0 ch tb0cnt ch tb1reg0 ch tb1cnt dh dh dh dh eh eh eh eh fh fh fh fh
tmp19a71 tmp19a71 18-8 address mnemonic address mnemonic address mnemonic address mnemonic ffffc740h tb2run ffffc750h tb2reg1 ffffc760h tb3run ffffc770h tb3reg1 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h tb2mod(l) 4h tb2cp0 4h tb3mod(l) 4h tb3cp0 5h (tb2modh) 5h 5h (tb3modh) 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h tb2ff 8h reserved 8h tb3ff 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch tb2reg0 ch tb2cnt ch tb3reg0 ch tb3cnt dh dh dh dh eh eh eh eh fh fh fh fh [6] wdt address mnemonic ffffc830h wdmod(l) 1h (wdmodh) 2h 3h 4h wdcr 5h 6h 7h 8h wdcnt 9h ah bh ch dh eh fh [7-1] adc (normal mode) address mnemonic address mnemonic address mnemonic address mnemonic ffffc900h adnres0 ffffc910h adnres4 ffffc920h adchpr0 ffffc930h adchpc0 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h adnres1 4h adnres5 4h adnmod0(l) 4h adcmp00 5h 5h 5h (adnmod0h) 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h adnres2 8h adnres6 8h adnclk0 8h adcmp01 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch adnres3 ch adnres7 ch cmpctl0(l) ch adcbasn0 dh dh dh (cmpctl0h) dh eh eh eh eh fh fh fh fh
under development tmp19a71 tmp19a71 18-9 address mnemonic ffffc940h adcstart0 1h 2h 3h 4h 5h 6h 7h 8h 9h ah bh ch dh eh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffc980h adnres8 ffffc990h adnres12 ffffc9a0h adchpr1 ffffc9b0h adchpc1 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h adnres9 4h adnres13 4h adnmod1(l) 4h adcmp10 5h 5h 5h (adnmod1h) 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h adnres10 8h adnres14 8h adnclk1 8h adcmp11 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch adnres11 ch adnres15 ch cmpctl1(l) ch adcbasn1 dh dh dh (cmpctl1h) dh eh eh eh eh fh fh fh fh address mnemonic ffffc9c0h adcstart1 1h 2h 3h 4h 5h 6h 7h 8h 9h ah bh ch dh eh fh
tmp19a71 tmp19a71 18-10 [7-2] adc (pmd mode) address mnemonic address mnemonic address mnemonic address mnemonic ffffcd00h adpres0 ffffcd10h adpres4 ffffcd20h reserved ffffcd30h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h adpres1 4h adpres5 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h adpres2 8h adpres6 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch adpres3 ch adpres7 ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffcd40h adcsett00(l) ffffcd50h reserved ffffcd60h adpmod01(l) ffffcd70h admodsel0 1h (adcsett00h) 1h 1h (adpmod01h) 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h reserved 4h reserved 4h adcne0(l) 4h 5h 5h 5h (adcne0h) 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h adcset00(l) 8h adpclk0 8h adcnt0 8h 9h (adcset00h) 9h 9h 9h ah ah ah ah bh bh bh bh ch adcset01(l) ch adpmod00 ch adcbasp0 ch dh (adcset01h) dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffcd80h adpres8 ffffc d90h adpres12 ffffcda0h adpr es16 ffffcdb0h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h adpres9 4h adpres13 4h adpres17 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h adpres10 8h adpres14 8h adpres18 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch adpres11 ch adpres15 ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh
under development tmp19a71 tmp19a71 18-11 address mnemonic address mnemonic address mnemonic address mnemonic ffffcdc0h adcsett10(l) ffffcdd0h adcset12(l) ffffcde0h adpmod11(l) ffffcdf0h admodsel1 1h (adcsett10h) 1h (adcset12h) 1h (adpmod11h) 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h adcsett11 4h reserved 4h adcne1(l) 4h 5h 5h 5h (adcne1h) 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h adcset10(l) 8h adpclk1 8h adcnt1 8h 9h (adcset10h) 9h 9h 9h ah ah ah ah bh bh bh bh ch adcset11(l) ch adpmod10 ch adcbasp1 ch dh (adcset11h) dh dh dh eh eh eh eh fh fh fh fh [8] irc address mnemonic address mnemonic address mnemonic address mnemonic ffffd000h imr00 ffffd010h imr16 ffffd020h imr32 ffffd030h imr48 1h (imr01) 1h (imr17) 1h (imr33) 1h (imr49) 2h (imr02) 2h (imr18) 2h (imr34) 2h (imr50) 3h (imr03) 3h (imr19) 3h (imr35) 3h (imr51) 4h imr04 4h imr20 4h imr36 4h imr52 5h (imr05) 5h (imr21) 5h (imr37) 5h (imr53) 6h (imr06) 6h (imr22) 6h (imr38) 6h (imr54) 7h (imr07) 7h (imr23) 7h (imr39) 7h (imr55) 8h imr08 8h imr24 8h imr40 8h imr56 9h (imr09) 9h (imr25) 9h (imr41) 9h (imr57) ah (imr10) ah (imr26) ah (imr42) ah (imr58) bh (imr11) bh (imr27) bh (imr43) bh (imr59) ch imr12 ch imr28 ch imr44 ch imr60 dh (imr13) dh (imr29) dh (imr45) dh (imr61) eh (imr14) eh (imr30) eh (imr46) eh (imr62) fh (imr15) fh (imr31) fh (imr47) fh (imr63) address mnemonic address mnemonic address mnemonic address mnemonic ffffd040h imr64 ffffd050h imr80 ffffd080h ivr ffffd070h 1h (imr65) 1h (imr81) 1h 1h 2h (imr66) 2h (imr82) 2h 2h 3h (imr67) 3h (imr83) 3h 3h 4h imr68 4h imr84 4h iclr 4h 5h (imr69) 5h (imr85) 5h 5h 6h (imr70) 6h (imr86) 6h 6h 7h (imr71) 7h (imr87) 7h 7h 8h imr72 8h imr88 8h ilev 8h 9h (imr73) 9h (imr89) 9h 9h ah (imr74) ah (imr90) ah ah bh (imr75) bh (imr91) bh bh ch imr76 ch imr92 ch ch dh (imr77) dh (imr93) dh dh eh (imr78) eh (imr94) eh eh fh (imr79) fh (imr95) fh fh
tmp19a71 tmp19a71 18-12 [9] clock generator address mnemonic address mnemonic address mnemonic address mnemonic ffffd300h clkact ffffd310h clknmi ffffd320h reserved ffffd330h reserved 1h 1h reserved 1h reserved 1h 2h 2h clkw0 2h 2h 3h 3h reserved 3h 3h 4h clkosc 4h reserved 4h 4h 5h clkwut 5h reserved 5h 5h 6h clkspd 6h reserved 6h 6h 7h clkprsc 7h reserved 7h 7h 8h reserved 8h reserved 8h 8h 9h reserved 9h reserved 9h 9h ah reserved ah clkint0 ah ah bh bh clkint1 bh bh ch reserved ch clkint2 ch ch dh clkmisc dh clkint3 dh dh eh eh reserved eh eh fh fh reserved fh fh [10] modec address mnemonic address mnemonic address mnemonic address mnemonic ffffd400h modecr ffffd410h ffffd420h ffffd430h 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h 4h 4h 4h 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h 8h 8h 8h 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch ch ch ch dh dh dh dh eh eh eh eh fh fh fh fh [11] dmac address mnemonic address mnemonic address mnemonic address mnemonic ffffd600h ccr0(ll) ffffd610h bcr0(ll) ffffd620h ccr1(ll) ffffd630h bcr1(ll) 1h (ccr0lh) 1h (bcr0lh) 1h (ccr1lh) 1h (bcr1lh) 2h (ccr0hl) 2h (bcr0hl) 2h (ccr1hl) 2h (bcr1hl) 3h (ccr0hh) 3h (bcr0hh) 3h (ccr1hh) 3h (bcr1hh) 4h csr0(ll) 4h 4h csr1(ll) 4h 5h (csr0lh) 5h 5h (csr1lh) 5h 6h (csr0hl) 6h 6h (csr1hl) 6h 7h (csr0hh) 7h 7h (csr1hh) 7h 8h sar0(ll) 8h dtcr0(ll) 8h sar1(ll) 8h dtcr1(ll) 9h (sar0lh) 9h (dtcr0lh) 9h (sar1lh) 9h (dtcr1lh) ah (sar0hl) ah (dtcr0hl) ah (sar1hl) ah (dtcr1hl) bh (sar0hh) bh (dtcr0hh) bh (sar1hh) bh (dtcr1hh) ch dar0(ll) ch ch dar1(ll) ch dh (dar0lh) dh dh (dar1lh) dh eh (dar0hl) eh eh (dar1hl) eh fh (dar0hh) fh fh (dar1hh) fh
under development tmp19a71 tmp19a71 18-13 address mnemonic address mnemonic address mnemonic address mnemonic ffffd640h ccr2(ll) ffffd650h bcr2(ll) ffffd660h ccr3(ll) ffffd670h bcr3(ll) 1h (ccr2lh) 1h (bcr2lh) 1h (ccr3lh) 1h (bcr3lh) 2h (ccr2hl) 2h (bcr2hl) 2h (ccr3hl) 2h (bcr3hl) 3h (ccr2hh) 3h (bcr2hh) 3h (ccr3hh) 3h (bcr3hh) 4h csr2(ll) 4h 4h csr3(ll) 4h 5h (csr2lh) 5h 5h (csr3lh) 5h 6h (csr2hl) 6h 6h (csr3hl) 6h 7h (csr2hh) 7h 7h (csr3hh) 7h 8h sar2(ll) 8h dtcr2(ll) 8h sar3(ll) 8h dtcr3(ll) 9h (sar2lh) 9h (dtcr2lh) 9h (sar3lh) 9h (dtcr3lh) ah (sar2hl) ah (dtcr2hl) ah (sar3hl) ah (dtcr3hl) bh (sar2hh) bh (dtcr2hh) bh (sar3hh) bh (dtcr3hh) ch dar2(ll) ch ch dar3(ll) ch dh (dar2lh) dh dh (dar3lh) dh eh (dar2hl) eh eh (dar3hl) eh fh (dar2hh) fh fh (dar3hh) fh address mnemonic address mnemonic address mnemonic address mnemonic ffffd680h ccr4(ll) ffffd690h bcr4(ll) ffffd6a0h ccr5(ll) ffffd6b0h bcr5(ll) 1h (ccr4lh) 1h (bcr4lh) 1h (ccr5lh) 1h (bcr5lh) 2h (ccr4hl) 2h (bcr4hl) 2h (ccr5hl) 2h (bcr5hl) 3h (ccr4hh) 3h (bcr4hh) 3h (ccr5hh) 3h (bcr5hh) 4h csr4(ll) 4h 4h csr5(ll) 4h 5h (csr4lh) 5h 5h (csr5lh) 5h 6h (csr4hl) 6h 6h (csr5hl) 6h 7h (csr4hh) 7h 7h (csr5hh) 7h 8h sar4(ll) 8h dtcr4(ll) 8h sar5(ll) 8h dtcr5(ll) 9h (sar4lh) 9h (dtcr4lh) 9h (sar5lh) 9h (dtcr5lh) ah (sar4hl) ah (dtcr4hl) ah (sar5hl) ah (dtcr5hl) bh (sar4hh) bh (dtcr4hh) bh (sar5hh) bh (dtcr5hh) ch dar4(ll) ch ch dar5(ll) ch dh (dar4lh) dh dh (dar5lh) dh eh (dar4hl) eh eh (dar5hl) eh fh (dar4hh) fh fh (dar5hh) fh address mnemonic address mnemonic address mnemonic address mnemonic ffffd6c0h ccr6(ll) ffffd6d0h bcr6(ll) ffffd6e0h ccr7(ll) ffffd6f0h bcr7(ll) 1h (ccr6lh) 1h (bcr6lh) 1h (ccr7lh) 1h (bcr7lh) 2h (ccr6hl) 2h (bcr6hl) 2h (ccr7hl) 2h (bcr7hl) 3h (ccr6hh) 3h (bcr6hh) 3h (ccr7hh) 3h (bcr7hh) 4h csr6(ll) 4h 4h csr7(ll) 4h 5h (csr6lh) 5h 5h (csr7lh) 5h 6h (csr6hl) 6h 6h (csr7hl) 6h 7h (csr6hh) 7h 7h (csr7hh) 7h 8h sar6(ll) 8h dtcr6(ll) 8h sar7(ll) 8h dtcr7(ll) 9h (sar6lh) 9h (dtcr6lh) 9h (sar7lh) 9h (dtcr7lh) ah (sar6hl) ah (dtcr6hl) ah (sar7hl) ah (dtcr7hl) bh (sar6hh) bh (dtcr6hh ) bh (sar7hh) bh (dtcr7hh) ch dar6(ll) ch ch dar7(ll) ch dh (dar6lh) dh dh (dar7lh) dh eh (dar6hl) eh eh (dar7hl) eh fh (dar6hh) fh fh (dar7hh) fh
tmp19a71 tmp19a71 18-14 address mnemonic address mnemonic address mnemonic address mnemonic ffffd700h dcr(ll) ffffd710h ffffd720h ffffd730h 1h (dcrlh) 1h 1h 1h 2h (dcrhl) 2h 2h 2h 3h (dcrhh) 3h 3h 3h 4h reserved 4h 4h 4h 5h reserved 5h 5h 5h 6h reserved 6h 6h 6h 7h reserved 7h 7h 7h 8h 8h 8h 8h 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch dhr(ll) ch ch ch dh (dhrlh) dh dh dh eh (dhrhl) eh eh eh fh (dhrhh) fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffd740h ffffd750h ffffd760h ffffd770h 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h 4h 4h 4h 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h 8h 8h 8h 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch ch ch ch dh dh dh dh eh eh eh eh fh fh fh fh
under development tmp19a71 tmp19a71 18-15 [12] flash memory (flash version only; dma not supported) address mnemonic address mnemonic address mnemonic ffffe510h seqmod ffffe520h flcs ffffe530h b0dcr 1h 1h 1h 2h 2h 2h 3h 3h 3h 4h seqcnt 4h 4h b0dlr 5h 5h 5h 6h 6h 6h 7h 7h 7h 8h reserved 8h 8h b1dcr 9h 9h 9h ah ah ah bh bh bh ch reserved ch ch b1dlr dh dh dh eh eh eh fh fh fh [13] rom correction (dma not supported) address mnemonic address mnemonic address mnemonic address mnemonic ffffe540h addreg0 ffffe550h addreg4 ffffe560h reserved ffffe570h reserved 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h addreg1 4h addreg5 4h reserved 4h reserved 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h addreg2 8h addreg6 8h reserved 8h reserved 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch addreg3 ch addreg7 ch reserved ch reserved dh dh dh dh eh eh eh eh fh fh fh fh
tmp19a71 tmp19a71 18-16 18.2 bus error area ffff_c000 ffff_d000 ffff_d6bc ffff_c0ff ports 0 to 3 ffff_d0ff irc ffff_d6bf (note 2) ffff_c100 ffff_d080 ffff_d6c0 ffff_c13f (note 1) ffff_d2ff (note 1) ffff_d6db dmac ffff_c140 ffff_d300 ffff_d6dc ffff_c2ff ports 5 to b ffff_d33f cg ffff_d6df (note 2) ffff_c300 ffff_d340 ffff_d6e0 ffff_c37f pmd ffff_d3ff (note 1) ffff_d6fb dmac ffff_c380 ffff_d400 ffff_d6fc ffff_c3ff (note 1) ffff_d4ff modec ffff_d6ff (note 2) ffff_c400 ffff_d500 ffff_d700 ffff_c43f enc ffff_d5ff (note 1) ffff_d707 dmac ffff_c440 ffff_d600 ffff_d708 ffff_c47f (note 1) ffff_d61b dmac ffff_d70b (note 2) ffff_c480 ffff_d61c ffff_d70c ffff_c4df sio ffff_d61f (note 2) ffff_d70f dmac ffff_c4e0 ffff_d620 ffff_d710 ffff_c6ff (note 1) ffff_d63b dmac ffff_d7ff (note 2) ffff_c700 ffff_d63c ffff_d800 ffff_c77f tmrb ffff_d63f (note 2) ffff_e3ff (note 1) ffff_c780 ffff_d640 ffff_e400 ffff_c82f (note 1) ffff_d65b dmac ffff_e40f reserved ffff_c830 ffff_d65c ffff_e410 ffff_c83f wdt ffff_d65f (note 2) ffff_e47f (note 1) ffff_c840 ffff_d660 ffff_e480 ffff_c8ff (note 1) ffff_d67b dmac ffff_e48b reserved ffff_c900 ffff_d67c ffff_e48c ffff_c9ff adc (normal) ffff_d67f (note 2) ffff_e4ff (note 2) ffff_ca00 ffff_d680 ffff_e500 ffff_ccff (note 1) ffff_d69b dmac ffff_e6ff flash /rom ffff_cd00 ffff_d69c ffff_e700 ffff_cdff adc (pmd) ffff_d69f (note 2) ffff_ffff (note 1) ffff_ce00 ffff_d6a0 ffff_cfff (note 1) ffff_d6bb dmac note 1: bus error area. a store access does not cause a bus error exception, but a nmi occurs.(modecr=0) note 2: bus error area, but a store access does not cause a nmi.
tmp19a71 19. electrical characteristics the letter x in equations presented in this chapter represents the fsys or imclk period selected by the clkprsc.prs1 or prs2 field. 19.1 maximum ratings mask-version product parameter symbol rating unit v cc15 (core) -0.3 to 3.0 v cc3 (i/o) -0.3 to 3.9 supply voltage avcc (ad) -0.3 to 3.6 v input voltage v in -0.3 to v cc3 + 0.3 (note 1) -0.3 to avcc + 0.3 (note 2) v per pin i ol 15 low-level output current total i ol 80 per pin i oh -15 high-level output current total i oh -50 ma power dissipation (ta = 85c) pd 600 mw 10 seconds t solder 260 soldering temperature 3 seconds t solder 350 average temperature ta ave -20 to 65 storage temperature t stg -65 to 150 operating temperature t opr -40 to 85 v cc 15 dvcc15 cvcc15, v cc 3 dvcc3, avcc avccn (n 0, 1), v ss dvss avss cvss note 1: the absolute maximum rating of v cc 3 (-0.3 to 3.9 v) must not be exceeded. note 2: since ports 5 to 7 use avcc as the power supply for each port function, the maximum rating for a vcc (-0.3 to 3.6 v) should be applied to these ports. note 3: maximum ratings are limiting values of operating and environmental conditions which should not be exceede d under the worst possible conditions. the equipment manumacturer should design so that no maximum rating value is exceeded with respect to current, voltage, power dissipation, temperature, etc. exposure to conditions beyond those listed above may cause permanent damage to the device or affect device reliability, which could increase potential risks of personal injury due to ic blowup and/or burning. tmp19a71 19-1
tmp19a71 flash-version product parameter symbol rating unit v cc2 (core) -0.3 to 3.6 v cc3 (i/o) -0.3 to 3.9 supply voltage avcc (a/d) -0.3 to3.6 v input voltage v in -0.3 to v cc3 + 0.3 (note 1) -0.3 to avcc + 0.3 (note 2) v per pin i ol 15 low-level output current total i ol 80 per pin i oh -15 high-level output current total i oh -50 ma power dissipation (ta = 85c) pd 1000 mw 10 seconds t solder 260 soldering temperature 3 seconds t solder 350 average temperature ta ave -20 to 65 storage temperature t stg -65 to 150 other than flash program/erase -40 to 85 operating temperature flash program/ erase t opr -0 to 60 flash reprogram times n we 100 cycle v cc 2 dvcc2 cvcc2 fvcc2, v cc 3 fvcc3 dvcc3, avcc avccn (n 0, 1), v ss dvss avss cvss fvss note 1: the absolute maximum rating of v cc 3 (-0.3 to 3.9v) must not be exceeded. note 2: since ports 5 to 7 use avcc as the power supply for each port function, the maximum rating for a vcc (-0.3 to 3.6 v) should be applied to these ports. note 3: maximum ratings are limiting values of operating and environmental conditions which should not be exceede d under the worst possible conditions. the equipment manufacturer should design so that no maximum rating value is exceeded with respect to current, voltage, power dissipation, temperature, etc. exposure to conditions beyond those listed above may cause permanent damage to the device or affect device reliability, which could increase potential risks of personal injury due to ic blowup and/or burning. note 4: the number of times the flash memory can be reprogrammed includes programming of nonvolatile bit s in the flash rom. note that programming nonvolatile bits to the same value is also counted in the reprogram times. tmp19a71 19-2
tmp19a71 19.2 recommended operat ing conditions mask-version product ta -40 to 85 parameter symbol conditions min. typ. (note 1) max. unit dvcc15 1.35 1.65 supply voltage dvcc15 cvc c15 dvcc3 cvss dvss avss 0v dvcc3 3.0 3.6 v avccn input clock = 4 to 7 mhz fsys = 32 to 56 mhz 3.0 3.6 p0, p1, p23, p3, p80-p83, p85, p86, p94, pa0-pa5, pb0-pb5 v il 3.0 v Q dvcc3 Q 3.6 v 0.3 dvcc3 p5-p63 (used as a port) v il1 3.0 v Q avccn (n=0, 1) Q 3.6 v 0.3 avccn p20-p22, p24, p64-p67, p70-p72, p84, p87, p90-p93, p95, pa6, pa7, pb6, pb7, p95/nmi, reset v il2 3.0 v Q dvcc3 Q 3.6 v 3.0 v Q avccn (n=0, 1) Q 3.6 v 0.2 dvcc3 (0.2 avccn) low-level input voltage x1 v il3 1.35 v Q cvcc 15 Q 1.65 v -0.3 0.1 cvcc15 v p0, p1, p23, p3, p80-p83, p85-p86, p94, pa0-pa5, pb0-pb5 v ih 3.0 v Q dvcc3 Q 3.6 v 0.7 dvcc3 dvcc3 p5-p63 (used as a port) v ih1 3.0 v Q avccn (n=0, 1) Q 3.6 v 0.7 avccn avccn p20-p22, p24, p64-p67, p70-p72, p84, p87, p90-p93, p95, pa6, pa7, pb6, pb7, p95/nmi, reset v ih2 3.0 v Q dvcc3 Q 3.6 v 3.0 v Q avccn (n=0, 1) Q 3.6 v 0.8 dvcc3 (0.8 avccn) dvcc3 (avccn) high-level input voltage x1 v ih3 1.35 v Q cvcc 15 Q 1.65 v 0.9 cvcc15 cvcc15 v note 1: recommended operating conditions are usage conditions recommended for proper operation of the device maintaining an expected level of quality. the equipment manufacturer should design so that no recommended operating condition is exceeded with respect to supply voltage, operating temperature range, ac/dc specifications, etc. using the device under conditions beyond those listed above may cause the device to malfunction. note 2: no maximum absolute rating as well as recommended operating condition must ever be exceeded. note 3: since avccn is also used as the power supply for ports 5 to 7, it should be connected to a power source even if the ad converter is not used. note 4: unless otherwise specified, the values specified for ports also apply to functions assigned to each port. tmp19a71 19-3
tmp19a71 flash-version product ta -40 to 85 parameter symbol conditions min. typ. (note 1) max. unit dvcc2 2.3 2.7 supply voltage dvcc2 fvcc2 cvcc2 dvcc3 fvcc3 cvss dvss fvss avss 0v dvcc3 3.0 3.6 v avccn input clock = 4 to 7 mhz fsys = 32 to 56 mhz 3.0 3.6 p0, p1, p23, p3, p80-p83, p85, p86, p94, pa0-pa5, pb0-pb5 v il 3.0 v Q dvcc3 Q 3.6 v 0.3 dvcc3 p5-p63 (used as a port) v il1 3.0 v Q avccn (n=0, 1) Q 3.6 v 0.3 avccn p20-p22, p24, p64-p67, p70-p72, p84, p87, p90-p93, p95, pa6, pa7, pb6, pb7, p95/nmi, reset v il2 3.0v Q dvcc3 Q 3.6 v 3.0 v Q avccn (n=0, 1) Q 3.6 v 0.2 dvcc3 (0.2 avccn) low-level input voltage x1 v il3 2.3 v Q cvcc2 Q 2.7 v -0.3 0.1 cvcc2 v p0, p1, p23, p3, p80-p83, p85, p86, p94, pa0-pa5, pb0-pb5 v ih 3.0 v Q dvcc3 Q 3.6 v 0.7 dvcc3 dvcc3 p5-p63 (used as a port) v ih1 3.0 v Q avccn (n=0, 1) Q 3.6 v 0.7 avccn avccn p20-p22, p24, p64-p67, p70-p72, p84, p87, p90-p93, p95, pa6, pa7, pb6, pb7, p95/nmi, reset v ih2 3.0 v Q dvcc3 Q 3.6 v 3.0 v Q avccn (n=0, 1) Q 3.6 v 0.8 dvcc3 (0.8 avccn) dvcc3 (avccn) high-level input voltage x1 v ih3 2.3 v Q cvcc2 Q 2.7 v 0.9 cvcc2 cvcc2 v note 1: recommended operating conditions are usage conditions recommended for proper operation of the device maintaining an expected level of quality. the equipment manufacturer should design so that no recommended operating condition is exceeded with respect to supply voltage, operating temperature range, ac/dc specifications, etc. using the device under conditions beyond those listed above may cause the device to malfunction. note 2: no maximum absolute rating as well as recommended operating condition must ever be exceeded. note 3: since avccn is also used as the power supply for ports 5 to 7, it should be connected to a power source even if the ad converter is not used. note 4: unless otherwise specified, the values specified for ports also apply to functions assigned to each port. tmp19a71 19-4
tmp19a71 19.3 dc electrical characteristics (1/2) mask-version product ta -40 to 85 parameter symbol conditions min. typ. (note1) max. unit low drive capability i ol = 0. 5 ma dvcc3 R 3.0 v i ol = 2 ma dvcc3 R 3.0 v 0.4 low-level output voltage (note 2) high drive capability v ol i ol = 10 ma dvcc3 R 3.0 v 1.0 low drive capability i oh = ? 0.5 ma dvcc3 R 3.0 v high-level output voltage (note 2) high drive capability v oh i oh = ? 2 ma dvcc3 R 3.0 v 2.4 v input leakage current i li 0.0 Q v in Q dvcc3 0.0 Q v in Q av ccn (n=0, 1) 0.02 5 output leakage current i lo 0.2 Q v in Q dvcc3 ? 0.2 0.2 Q v in Q avccn ? 0.2 (n=0, 1) 0.05 10 a hysteresis (schmitt width) p20-p22, p24, p64-p67, p70-p72, p84, p 87, p90-p93, p95, pa6, a7, pb6, pb7, p95/nmi, reset vin 3.0v Q dvcc3 Q 3.6v 3.0 v Q avccn (n=0, 1) Q 3.6 v 0.4 0.9 1.6 v pull-up resistor pup dvcc3 = 3.0 v to 3.6 v 40 100 185 k ? pin capacitance (excluding powe r supply pins) c io fc = 1 mhz 10 pf note 1: ta = 25 , dvcc3 = 3.3 v, dvcc15 = 1.5v and avccn = 3.3 v, unless otherwise noted. note 2: the drive capability can be set to low or high in the pndssr register for each port. flash-version product ta -40 to 85 parameter symbol conditions min. typ. (note 1) max. unit low drive capability i ol = 0.5ma dvcc3 R 3.0v i ol = 2ma dvcc3 R 3.0v 0.4 low-level output voltage (note 2) high drive capability v ol i ol = 10 ma dvcc3 R 3.0v 1.0 low drive capability i oh = ? 0.5ma dvcc3 R 3.0v high-level output voltage (note 2) high drive capability v oh i oh = ? 2ma dvcc3 R 3.0v 2.4 v input leakage current i li 0.0 Q v in Q dvcc3 0.0 Q v in Q avccn (n=0, 1 ) 0.02 5 output leakage current i lo 0.2Q v in Q dvcc3 ? 0.2 0.2 Q v in Q avccn ? 0.2 (n=0, 1) 0.05 10 a hysteresis (schmitt width) p20-p22, p24, p64-p67, p70-p72, p84, p 87, p90-p93, p95, pa6, pa7, pb6, pb7, p95/nmi, reset vin 3.0v Q dvcc3 Q 3.6 v 3.0 v Q avccn (n=0, 1) Q 3.6 v 0.4 0.9 1.6 v pull-up resistor pup dvcc3 = 3.0 v to 3.6 v 40 100 185 k ? pin capacitance (excluding powe r supply pins) c io fc = 1 mhz 10 pf note 1: ta = 25 , dvcc3= 3.3v, dvcc2=2.5v and avccn=3.3v, unless otherwise noted. note 2: the drive capability can be set to low or high in the pndssr register for each port. tmp19a71 19-5
tmp19a71 19.4 dc electrical characteristics (2/2) mask-version product dvcc15 cvcc15 1.35 v to 1.65 v, dvcc3 3.0 v to 3.6 v, avccn 3.0 v to 3.6 v, ta -40 to 85 (n 0, 1) parameter symbol conditions min. typ. (note 1) max. (note 2) unit normal 1.5v (note 3) i ccn15 70 90 idle (doze) i ccd 45 60 idle (halt) i cch f sy s = 56 mhz (input clock = 7 mhz, pll x16, gear ratio = 1/2) 45 60 ma stop i ccst dvcc15 = cv cc15 = 1.35 to 1.65v dvcc3 = 3.0 to 3.6v avccn = 3.0 to 3 .6v 3 5 ma note 1: ta = 25 , dvcc3= 3.3v, dvcc15=1.5v and avccn=3.3v, unless otherwise noted. note 2: max. values are theoretical maximum values that should not be exceeded under the worst possible conditions. note 3: i ccn ( typ) measurement conditions: run an arithemetic program provided by toshiba with all internal peripheral active. flash-version product dvcc2 cvcc2 2.3 v to 2.7 v, dvcc3 3.0 v to 3.6 v, avccn 3.0 v to 3.6 v, ta -40 to 85 (n 0, 1) parameter symbol conditions min. typ. (note 1) max. (note 2) unit normal 2.5v (note 3) i ccn2 212 285 idle (doze) i ccd2 130 200 idle (halt) i cch2 f sy s = 56 mhz (input clock = 7 mhz, pll x16, gear ratio = 1/2) 120 190 ma stop i ccst dvcc2 = cv cc2 = 2.3 to 2.7 v dvcc3 = 3.0 to 3.6 v avccn = 3.0 to 3.6 v 11 1000 a note 1: ta = 25 , dvcc3= 3.3v, dvcc2=2.5v and avccn=3.3v, unless otherwise noted. note 2: max. values are theoretical maximum values that should not be exceeded under the worst possible conditions. note 3: i ccn (typ) measurement conditions: run an arithmetic program provided by toshiba with all internal peripherals acitve. tmp19a71 19-6
tmp19a71 19.5 10-bit ad conversion characteristics mask-version product dvcc15 = cvcc15 = 1.35 to 1.65 v, dvcc3 = 3.0 to 3.6 v, avccn = vrefh = 3.0 to 3.6 v, avss = dvss = vrefl = 0 v, ta -40 to 85 parameter symbol conditions min typ max unit analog reference voltage (+) (note 3) vrefh 3.0 3.6 v analog input voltage vain avss avccn v integral nonlinearity error (note 6) ? 1.5 3 lsb differential nonlinearity error ? 1 2 lsb offset error ? 4 7 lsb gain error ? 2 4 lsb relative error (note 5) ? 4 8 lsb total error ? avccn = vrefh = 3.0 t o 3.6 v dvss = avss avccn load capacitance R 10 f vrefh load capacitance R 10 f conversion time R 2.36 s 4 7 lsb note 1: 1 lsb = (vrefh ? vrefl)/1024 [v] note 2: the supply current flowing through the avccn pin is included in the digital supply current parameter (i cc ). note 3: the vrefhn pin is shared with the avccn pin. note 4: the above characteristics apply when the adc input pins are not used for other functions. note 5: indicates the difference between the minimum and maximum conversion errors. note 6: indicates a value after offset and gain errors have been adjusted. tmp19a71 19-7
tmp19a71 flash-version product dvcc2 = fvcc2 = cvcc2 = 2.5 0.2 v, dvcc3 = 3.3 0.3 v, avccn = vrefh = 3.0 to 3.6 v, avss = dvss = vrefl = 0 v, ta -40 to 85 parameter symbol condition min typ max unit analog reference voltage (+) (note 3) vrefh 3.0 3.6 v analog input voltage vain avss avccn v integral nonlinearity error (note 6) ? 1.5 3 lsb differential nonlinearity error ? 1 2 lsb offset error ? 4 7 lsb gain error ? 2 4 lsb relative error (note 6) ? 4 8 lsb total error ? avccn = vrefh = 3.0 to 3.6v dvss = avss avccn load capacitance R 10 f vrefh load capacitance R 10 f conversion time R 2.36 s 4 7 lsb note 1: 1 lsb = (vrefh ? vrefl)/1024 [v] note 2: the supply current flowing through the avccn pin is included in the digital supply current parameter (i cc ). note 3: the vrefhn pin is shared with the avccn pin. note 4: the above characteristics apply when the adc input pins are not used for other functions. note 5: indicates the difference between the minimum and maximum conversion errors. note 6: indicates a value after offset and gain errors have been adjusted. tmp19a71 19-8
tmp19a71 19.6 sio timings mask-version product (1) i/o interface mode (dvcc3 = 3.3 0.3 v, dvcc15 = 1.5 0.15 v, ta = -40 to 85 c) the letter x in the tables below represents the system clock fsys period which depends on the clock gea r setting. ? sclk input mode (sio2) equation 56 mhz parameter symbol min max min max unit sclk period t scy 16x 286 ns txd data to sclk rise or fall * t oss (tscy/2) - 4x - 23 50 ns txd data hold after sclk rise or fall* t ohs (tscy/2) + 2x 179 ns rxd data valid to sclk rise or fall* t srd 2x + 8 44 ns rxd data hold after sclk rise or fall* t hsr 0 0 ns *) sclk rise or fall: measured relative to the programmed active edge of sclk. ? sclk output mode (sio2) equation 56 mhz parameter symbol min max min max unit sclk period (programmable) t scy 16x 286 ns txd data to sclk rise t oss (tscy/2) - 15 128 ns txd data hold after sclk rise t ohs (tscy/2) - 15 128 ns rxd data valid to sclk rise t srd 2x + 23 59 ns rxd data hold after sclk rise t hsr 0 0 ns output data txd input data rxd sclk output mode a ctive-high 0 valid t oss t scy t ohs 1 2 3 t srd t hsr 0 1 2 3 valid valid valid sclk input mode a ctive-low note 1: output level measurement conditions: high 0.8dvcc3 [v] / low 0.2dvcc3 [v], cl=30 pf note 2: input level measurement conditio n s: high 0.7dvcc3 [v] / low 0.2dvcc3 [v] tmp19a71 19-9
tmp19a71 flash-version product (1) i/o interface mode (dvcc3 = 3.3 0.3 v, dvcc2 = 2.5 0.2 v, ta = -40 to 85 oc) the letter x in the tables below represents the system clock fsys period which depends on the clock gea r setting. ? sclk input mode (sio2) equation 56 mhz parameter symbol min max min max unit sclk period t scy 16x 286 ns txd data to sclk rise or fall* t oss (tscy/2) - 4x - 23 50 ns txd data hold after sclk rise or fall* t ohs (tscy/2) + 2x 179 ns rxd data valid to sclk rise or fall* t srd 2x + 8 44 ns rxd data hold after sclk rise or fall* t hsr 0 0 ns *) sclk rise or fall: measured relative to the programmed active edge of sclk ? sclk output mode (sio2) equation 56 mhz parameter symbol min max min max unit sclk period (programmable) t scy 16x 286 ns txd data to sclk rise t oss (tscy/2) ? 15 128 ns txd data hold after sclk rise t ohs (tscy/2) ? 15 128 ns rxd data valid to sclk rise t srd 2x + 23 59 ns rxd data hold after sclk rise t hsr 0 0 ns output data txd input data rxd sclk output mode a ctive-high 0 valid t oss t scy t ohs 1 2 3 t srd t hsr 0 1 2 3 valid valid valid sclk input mode a ctive-low note 1: output level measurement conditions: high 0.8dvcc3 [v] / low 0.2dvcc3 [v], cl=30 pf note 2: input level measurement conditio n s: high 0.7dvcc3 [v] / low 0.2dvcc3 [v] tmp19a71 19-10
tmp19a71 19.7 event counter mask-version and flash-version products the letter x in the table below represents the imclk period. equation imclk = 28 mhz parameter symbol min max min max unit clock low-level pulse width t vckl x + 100 136 ns clock high-level pulse width t vckh x + 100 136 ns 19.8 capture mask-version and flash-version products the letter x in the table below represents the imclk period. equation imclk = 28 mhz parameter symbol min max min max unit low-level pulse width t cpl x + 100 136 ns high-level pulse width t cph x + 100 136 ns 19.9 interrupts (intc) mask-version and flash-version products the letter x in the table below repres ents the system clock fsys period. equation fsys = 56 mhz parameter symbol min max min max unit int0 to a low-level pulse width t intal x + 100 118 ns int0 to a high-level pulse width t intah x + 100 118 ns 19.10 interrupts (nmi, stop wakeup interrupt) mask-version and flash-version products equation fsys = 56 mhz parameter symbol min max min max unit nmi, int0 to 4 low-level pulse width t intbl 100 100 ns int0 to 4 high-level pulse width t intbh 100 100 ns tmp19a71 19-11
tmp19a71 19.11 adtrg input mask-version and flash-version products the letter x in the table below represents the imclk period. equation imclk = 28 mhz parameter symbol min max min max unit adtrg low-level pulse width tad l x + 100 136 ns adtrg high-level pulse width tadh x + 100 136 ns tmp19a71 19-12
tmp19a71 20. package dimensions 20.1 p-lqfp-1414-0.50f tmp19a71 20-1
tmp19a71 20.2 p-qfp-1420-0.65a tmp19a71 20-2


▲Up To Search▲   

 
Price & Availability of TMP19A71CYUG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X